#define PPP_ADDR 0xFF
#define PPP_CTRL 0x03
+#define NET_RX_L2TP_CONTROL_MSG 2
+
union unaligned {
__u32 u32;
} __attribute__((packed));
goto drop;
/* Put it back if it is a control packet. */
- if (skb->data[sizeof(struct udphdr)] & L2TP_CONTROL_BIT)
+ if (skb->data[sizeof(struct udphdr)] & L2TP_CONTROL_BIT) {
+ if (!opt->backlog_rcv)
+ return NET_RX_L2TP_CONTROL_MSG;
+
return opt->backlog_rcv(sk_udp, skb);
+ }
/* Skip UDP header. */
skb_pull(skb, sizeof(struct udphdr));
static int pppolac_recv(struct sock *sk_udp, struct sk_buff *skb)
{
+ int ret = 0;
+
sock_hold(sk_udp);
- sk_receive_skb(sk_udp, skb, 0);
+ ret = sk_receive_skb(sk_udp, skb, 0);
+ if (ret == NET_RX_L2TP_CONTROL_MSG)
+ return 1;
+
return 0;
}