]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ip_output.c
[NET]: Prevent transmission after dev_deactivate
[net-next-2.6.git] / net / ipv4 / ip_output.c
index f75ff1d96551d1e03cbfba7153c1bedb9b6e36df..8538aac3d14805545b500f366a0cc433b3200ef1 100644 (file)
@@ -86,8 +86,6 @@
 
 int sysctl_ip_default_ttl = IPDEFTTL;
 
-static int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*));
-
 /* Generate a checksum for an outgoing IP datagram. */
 __inline__ void ip_send_check(struct iphdr *iph)
 {
@@ -412,6 +410,7 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
        nf_bridge_get(to->nf_bridge);
 #endif
 #endif
+       skb_copy_secmark(to, from);
 }
 
 /*
@@ -421,7 +420,7 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
  *     single device frame, and queue such a frame for sending.
  */
 
-static int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
+int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 {
        struct iphdr *iph;
        int raw = 0;
@@ -673,6 +672,8 @@ fail:
        return err;
 }
 
+EXPORT_SYMBOL(ip_fragment);
+
 int
 ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb)
 {
@@ -839,7 +840,7 @@ int ip_append_data(struct sock *sk,
         */
        if (transhdrlen &&
            length + fragheaderlen <= mtu &&
-           rt->u.dst.dev->features&(NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM) &&
+           rt->u.dst.dev->features & NETIF_F_ALL_CSUM &&
            !exthdrlen)
                csummode = CHECKSUM_HW;
 
@@ -904,7 +905,7 @@ alloc_new_skb:
                         * because we have no idea what fragment will be
                         * the last.
                         */
-                       if (datalen == length)
+                       if (datalen == length + fraggap)
                                alloclen += rt->u.dst.trailer_len;
 
                        if (transhdrlen) {