Thread (3 messages) flat view 3 messages, 3 authors, 2016-08-22

Re: [PATCH v4 net-next] l2tp: Refactor the codes with existing macros instead of literal number

From: Feng Gao <hidden>
Date: 2016-08-22 14:57:28

Sorry, I forget to run the check_patch.pl script this time.
Now I send the v5 update.

Regards
Feng

On Mon, Aug 22, 2016 at 10:43 PM, Guillaume Nault [off-list ref] wrote:
On Mon, Aug 22, 2016 at 06:59:51PM +0800, fgao@ikuai8.com wrote:
quoted
From: Gao Feng <redacted>

Use PPP_ALLSTATIONS, PPP_UI, and SEND_SHUTDOWN instead of 0xff,
0x03, and 2 separately.
Apart from the checkpatch errors,

Acked-by: Guillaume Nault <redacted>
quoted
@@ -325,8 +324,8 @@ static int pppol2tp_sendmsg(struct socket *sock, struct msghdr *m,
      skb_reserve(skb, uhlen);

      /* Add PPP header */
-     skb->data[0] = ppph[0];
-     skb->data[1] = ppph[1];
+     skb->data[0] = PPP_ALLSTATIONS;
Trailing whitespace.
quoted
@@ -398,14 +396,14 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
                 sizeof(struct iphdr) + /* IP header */
                 uhlen +              /* UDP header (if L2TP_ENCAPTYPE_UDP) */
                 session->hdr_len +   /* L2TP header */
-                sizeof(ppph);        /* PPP header */
+                2;                   /* 2 bytes for PPP_ALLSTATIONS & PPP_UI */
      if (skb_cow_head(skb, headroom))
              goto abort_put_sess_tun;

      /* Setup PPP header */
-     __skb_push(skb, sizeof(ppph));
-     skb->data[0] = ppph[0];
-     skb->data[1] = ppph[1];
+     __skb_push(skb, 2);
Here too.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help