net: replace ipfragok with skb->local_df
authorShan Wei <shanwei@cn.fujitsu.com>
Thu, 15 Apr 2010 16:43:08 +0000 (16:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Apr 2010 06:36:37 +0000 (23:36 -0700)
As Herbert Xu said: we should be able to simply replace ipfragok
with skb->local_df. commit f88037(sctp: Drop ipfargok in sctp_xmit function)
has droped ipfragok and set local_df value properly.

The patch kills the ipfragok parameter of .queue_xmit().

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
include/net/inet6_connection_sock.h
include/net/inet_connection_sock.h
include/net/ip.h
include/net/ipv6.h
net/dccp/ipv6.c
net/dccp/output.c
net/ipv4/ip_output.c
net/ipv4/tcp_output.c
net/ipv6/inet6_connection_sock.c
net/ipv6/ip6_output.c
net/ipv6/tcp_ipv6.c
net/l2tp/l2tp_core.c
net/l2tp/l2tp_ip.c
net/sctp/ipv6.c
net/sctp/protocol.c

index f13ddc2543b1fcb07a10aee710a7e43b0f894d17..aae08f6866331eb5de5454e4724911aefd067fd0 100644 (file)
@@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk,
 
 extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
 
-extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok);
+extern int inet6_csk_xmit(struct sk_buff *skb);
 #endif /* _INET6_CONNECTION_SOCK_H */
index 52c8b8b8a0b964bfac316202c1218ba0694962dc..b6d3b55da19b49e71d5cc7e0206090240cca0346 100644 (file)
@@ -36,7 +36,7 @@ struct tcp_congestion_ops;
  * (i.e. things that depend on the address family)
  */
 struct inet_connection_sock_af_ops {
-       int         (*queue_xmit)(struct sk_buff *skb, int ipfragok);
+       int         (*queue_xmit)(struct sk_buff *skb);
        void        (*send_check)(struct sock *sk, struct sk_buff *skb);
        int         (*rebuild_header)(struct sock *sk);
        int         (*conn_request)(struct sock *sk, struct sk_buff *skb);
index 503994a38ed11a2cbaa97f2ef2e15417b08390ce..a84ceb692687c57e50b7bd5d2a989d3b17e481a0 100644 (file)
@@ -101,7 +101,7 @@ extern int          ip_do_nat(struct sk_buff *skb);
 extern void            ip_send_check(struct iphdr *ip);
 extern int             __ip_local_out(struct sk_buff *skb);
 extern int             ip_local_out(struct sk_buff *skb);
-extern int             ip_queue_xmit(struct sk_buff *skb, int ipfragok);
+extern int             ip_queue_xmit(struct sk_buff *skb);
 extern void            ip_init(void);
 extern int             ip_append_data(struct sock *sk,
                                       int getfrag(void *from, char *to, int offset, int len,
index 033ddd4652a589334d1533b107769d9deb5889df..b1d8db90b2142db5a28c73df759d5afb16b2ed57 100644 (file)
@@ -482,8 +482,7 @@ extern int                  ip6_rcv_finish(struct sk_buff *skb);
 extern int                     ip6_xmit(struct sock *sk,
                                         struct sk_buff *skb,
                                         struct flowi *fl,
-                                        struct ipv6_txoptions *opt,
-                                        int ipfragok);
+                                        struct ipv6_txoptions *opt);
 
 extern int                     ip6_nd_hdr(struct sock *sk,
                                           struct sk_buff *skb,
index ab1ab95946dfaeed03dfe846eb37ca48689f5398..091698899594388bbfb65678ce2ca8d1061283aa 100644 (file)
@@ -292,7 +292,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req,
                                                         &ireq6->loc_addr,
                                                         &ireq6->rmt_addr);
                ipv6_addr_copy(&fl.fl6_dst, &ireq6->rmt_addr);
-               err = ip6_xmit(sk, skb, &fl, opt, 0);
+               err = ip6_xmit(sk, skb, &fl, opt);
                err = net_xmit_eval(err);
        }
 
@@ -347,7 +347,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
        if (!ip6_dst_lookup(ctl_sk, &dst, &fl)) {
                if (xfrm_lookup(net, &dst, &fl, NULL, 0) >= 0) {
                        skb_dst_set(skb, dst);
-                       ip6_xmit(ctl_sk, skb, &fl, NULL, 0);
+                       ip6_xmit(ctl_sk, skb, &fl, NULL);
                        DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
                        DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);
                        return;
index b8d98e3c052aca7816fc39c5536b921ac030ab07..e98b65e9569f2748b6b5a1c8dbd846754993f63f 100644 (file)
@@ -136,7 +136,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
 
                DCCP_INC_STATS(DCCP_MIB_OUTSEGS);
 
-               err = icsk->icsk_af_ops->queue_xmit(skb, 0);
+               err = icsk->icsk_af_ops->queue_xmit(skb);
                return net_xmit_eval(err);
        }
        return -ENOBUFS;
index c65f18e0936e7b93ede848398648f8174a669f35..512af81b750f97ba086285ce764de0e7095d522a 100644 (file)
@@ -311,7 +311,7 @@ int ip_output(struct sk_buff *skb)
                            !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
 
-int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
+int ip_queue_xmit(struct sk_buff *skb)
 {
        struct sock *sk = skb->sk;
        struct inet_sock *inet = inet_sk(sk);
@@ -370,7 +370,7 @@ packet_routed:
        skb_reset_network_header(skb);
        iph = ip_hdr(skb);
        *((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff));
-       if (ip_dont_fragment(sk, &rt->u.dst) && !ipfragok)
+       if (ip_dont_fragment(sk, &rt->u.dst) && !skb->local_df)
                iph->frag_off = htons(IP_DF);
        else
                iph->frag_off = 0;
index e46849989a53ef0acf90717549b6b4f3340923a9..2b7d71fb84396877c1ce2b4b6c6e2470248b6c1d 100644 (file)
@@ -890,7 +890,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
        if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
                TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS);
 
-       err = icsk->icsk_af_ops->queue_xmit(skb, 0);
+       err = icsk->icsk_af_ops->queue_xmit(skb);
        if (likely(err <= 0))
                return err;
 
index 628db24bcf22bceff783384ea7779a87c4cb0ab7..0c5e3c3b7fd56d87222ec0c5a691f1e961a9f58b 100644 (file)
@@ -178,7 +178,7 @@ struct dst_entry *__inet6_csk_dst_check(struct sock *sk, u32 cookie)
        return dst;
 }
 
-int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
+int inet6_csk_xmit(struct sk_buff *skb)
 {
        struct sock *sk = skb->sk;
        struct inet_sock *inet = inet_sk(sk);
@@ -234,7 +234,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
        /* Restore final destination back after routing done */
        ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
 
-       return ip6_xmit(sk, skb, &fl, np->opt, 0);
+       return ip6_xmit(sk, skb, &fl, np->opt);
 }
 
 EXPORT_SYMBOL_GPL(inet6_csk_xmit);
index f3a847e3ec88aad0c9daaa887d2333b40a831376..141819f0c6f1f0d7532173c279b88ddf67c1e2ff 100644 (file)
@@ -185,7 +185,7 @@ int ip6_output(struct sk_buff *skb)
  */
 
 int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
-            struct ipv6_txoptions *opt, int ipfragok)
+            struct ipv6_txoptions *opt)
 {
        struct net *net = sock_net(sk);
        struct ipv6_pinfo *np = inet6_sk(sk);
index b429dfdd69dce9405d9eae23c9ef560f09c25751..bd5ef7b6e48ea3ca2c2c74b9a42c4b391894fed9 100644 (file)
@@ -509,7 +509,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
                __tcp_v6_send_check(skb, &treq->loc_addr, &treq->rmt_addr);
 
                ipv6_addr_copy(&fl.fl6_dst, &treq->rmt_addr);
-               err = ip6_xmit(sk, skb, &fl, opt, 0);
+               err = ip6_xmit(sk, skb, &fl, opt);
                err = net_xmit_eval(err);
        }
 
@@ -1071,7 +1071,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
        if (!ip6_dst_lookup(ctl_sk, &dst, &fl)) {
                if (xfrm_lookup(net, &dst, &fl, NULL, 0) >= 0) {
                        skb_dst_set(buff, dst);
-                       ip6_xmit(ctl_sk, buff, &fl, NULL, 0);
+                       ip6_xmit(ctl_sk, buff, &fl, NULL);
                        TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
                        if (rst)
                                TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
index 98dfcce1a5fcf62dab464ffbede408fe366ac24d..ecc7aea9efe4e19296476cd06e5cb66b2a593f63 100644 (file)
@@ -954,7 +954,8 @@ int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, size_t dat
        }
 
        /* Queue the packet to IP for output */
-       error = ip_queue_xmit(skb, 1);
+       skb->local_df = 1;
+       error = ip_queue_xmit(skb);
 
        /* Update stats */
        if (error >= 0) {
index 75bf784ba18de37ea848746e8afd16b026764c5c..0852512d392cb6ac7e9ed7bad87663154f70f64e 100644 (file)
@@ -501,7 +501,7 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
        skb_dst_set(skb, dst_clone(&rt->u.dst));
 
        /* Queue the packet to IP for output */
-       rc = ip_queue_xmit(skb, 0);
+       rc = ip_queue_xmit(skb);
 
 error:
        /* Update stats */
index 14db5689fb89d74082107dd00dfaa7e8a9c44b9f..732689140fb864d40f0cd109e92288bb74373a4c 100644 (file)
@@ -232,7 +232,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
        if (!(transport->param_flags & SPP_PMTUD_ENABLE))
                skb->local_df = 1;
 
-       return ip6_xmit(sk, skb, &fl, np->opt, 0);
+       return ip6_xmit(sk, skb, &fl, np->opt);
 }
 
 /* Returns the dst cache entry for the given source and destination ip
index a56f98e82f92f0a0dbd53d2045ab7d8053ab1454..704298f4b2842e4e812e1be2219416e4bf71b5e0 100644 (file)
@@ -854,7 +854,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
                         IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
 
        SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
-       return ip_queue_xmit(skb, 0);
+       return ip_queue_xmit(skb);
 }
 
 static struct sctp_af sctp_af_inet;