diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/8021q/vlan_core.c | 2 | ||||
| -rw-r--r-- | net/atm/br2684.c | 7 | ||||
| -rw-r--r-- | net/bridge/br_if.c | 12 | ||||
| -rw-r--r-- | net/bridge/br_notify.c | 7 | ||||
| -rw-r--r-- | net/bridge/netfilter/ebtables.c | 3 | ||||
| -rw-r--r-- | net/core/scm.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ip_output.c | 1 | ||||
| -rw-r--r-- | net/ipv4/ip_sockglue.c | 9 | ||||
| -rw-r--r-- | net/ipv4/netfilter.c | 18 | ||||
| -rw-r--r-- | net/ipv4/raw.c | 3 | ||||
| -rw-r--r-- | net/ipv4/route.c | 9 | ||||
| -rw-r--r-- | net/ipv4/syncookies.c | 2 | ||||
| -rw-r--r-- | net/ipv6/ipv6_sockglue.c | 9 | ||||
| -rw-r--r-- | net/ipv6/sit.c | 3 | ||||
| -rw-r--r-- | net/ipv6/syncookies.c | 2 | ||||
| -rw-r--r-- | net/netfilter/nf_queue.c | 1 | ||||
| -rw-r--r-- | net/netlabel/netlabel_kapi.c | 20 | ||||
| -rw-r--r-- | net/sched/act_mirred.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_prio.c | 2 |
19 files changed, 70 insertions, 45 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index 5f27f8e30254..f1f2f7bb6661 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
| @@ -167,6 +167,8 @@ struct sk_buff *vlan_untag(struct sk_buff *skb) | |||
| 167 | if (unlikely(!skb)) | 167 | if (unlikely(!skb)) |
| 168 | goto err_free; | 168 | goto err_free; |
| 169 | 169 | ||
| 170 | skb_reset_network_header(skb); | ||
| 171 | skb_reset_transport_header(skb); | ||
| 170 | return skb; | 172 | return skb; |
| 171 | 173 | ||
| 172 | err_free: | 174 | err_free: |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 52cfd0c3ea71..d07223c834af 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
| @@ -558,12 +558,13 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg) | |||
| 558 | spin_unlock_irqrestore(&rq->lock, flags); | 558 | spin_unlock_irqrestore(&rq->lock, flags); |
| 559 | 559 | ||
| 560 | skb_queue_walk_safe(&queue, skb, tmp) { | 560 | skb_queue_walk_safe(&queue, skb, tmp) { |
| 561 | struct net_device *dev = skb->dev; | 561 | struct net_device *dev; |
| 562 | |||
| 563 | br2684_push(atmvcc, skb); | ||
| 564 | dev = skb->dev; | ||
| 562 | 565 | ||
| 563 | dev->stats.rx_bytes -= skb->len; | 566 | dev->stats.rx_bytes -= skb->len; |
| 564 | dev->stats.rx_packets--; | 567 | dev->stats.rx_packets--; |
| 565 | |||
| 566 | br2684_push(atmvcc, skb); | ||
| 567 | } | 568 | } |
| 568 | 569 | ||
| 569 | /* initialize netdev carrier state */ | 570 | /* initialize netdev carrier state */ |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 3176e2e13d9b..e73815456adf 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
| @@ -231,6 +231,7 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, | |||
| 231 | int br_add_bridge(struct net *net, const char *name) | 231 | int br_add_bridge(struct net *net, const char *name) |
| 232 | { | 232 | { |
| 233 | struct net_device *dev; | 233 | struct net_device *dev; |
| 234 | int res; | ||
| 234 | 235 | ||
| 235 | dev = alloc_netdev(sizeof(struct net_bridge), name, | 236 | dev = alloc_netdev(sizeof(struct net_bridge), name, |
| 236 | br_dev_setup); | 237 | br_dev_setup); |
| @@ -240,7 +241,10 @@ int br_add_bridge(struct net *net, const char *name) | |||
| 240 | 241 | ||
| 241 | dev_net_set(dev, net); | 242 | dev_net_set(dev, net); |
| 242 | 243 | ||
| 243 | return register_netdev(dev); | 244 | res = register_netdev(dev); |
| 245 | if (res) | ||
| 246 | free_netdev(dev); | ||
| 247 | return res; | ||
| 244 | } | 248 | } |
| 245 | 249 | ||
| 246 | int br_del_bridge(struct net *net, const char *name) | 250 | int br_del_bridge(struct net *net, const char *name) |
| @@ -417,6 +421,7 @@ put_back: | |||
| 417 | int br_del_if(struct net_bridge *br, struct net_device *dev) | 421 | int br_del_if(struct net_bridge *br, struct net_device *dev) |
| 418 | { | 422 | { |
| 419 | struct net_bridge_port *p; | 423 | struct net_bridge_port *p; |
| 424 | bool changed_addr; | ||
| 420 | 425 | ||
| 421 | p = br_port_get_rtnl(dev); | 426 | p = br_port_get_rtnl(dev); |
| 422 | if (!p || p->br != br) | 427 | if (!p || p->br != br) |
| @@ -425,9 +430,12 @@ int br_del_if(struct net_bridge *br, struct net_device *dev) | |||
| 425 | del_nbp(p); | 430 | del_nbp(p); |
| 426 | 431 | ||
| 427 | spin_lock_bh(&br->lock); | 432 | spin_lock_bh(&br->lock); |
| 428 | br_stp_recalculate_bridge_id(br); | 433 | changed_addr = br_stp_recalculate_bridge_id(br); |
| 429 | spin_unlock_bh(&br->lock); | 434 | spin_unlock_bh(&br->lock); |
| 430 | 435 | ||
| 436 | if (changed_addr) | ||
| 437 | call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); | ||
| 438 | |||
| 431 | netdev_update_features(br->dev); | 439 | netdev_update_features(br->dev); |
| 432 | 440 | ||
| 433 | return 0; | 441 | return 0; |
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c index 6545ee9591d1..a76b62135558 100644 --- a/net/bridge/br_notify.c +++ b/net/bridge/br_notify.c | |||
| @@ -34,6 +34,7 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v | |||
| 34 | struct net_device *dev = ptr; | 34 | struct net_device *dev = ptr; |
| 35 | struct net_bridge_port *p; | 35 | struct net_bridge_port *p; |
| 36 | struct net_bridge *br; | 36 | struct net_bridge *br; |
| 37 | bool changed_addr; | ||
| 37 | int err; | 38 | int err; |
| 38 | 39 | ||
| 39 | /* register of bridge completed, add sysfs entries */ | 40 | /* register of bridge completed, add sysfs entries */ |
| @@ -57,8 +58,12 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v | |||
| 57 | case NETDEV_CHANGEADDR: | 58 | case NETDEV_CHANGEADDR: |
| 58 | spin_lock_bh(&br->lock); | 59 | spin_lock_bh(&br->lock); |
| 59 | br_fdb_changeaddr(p, dev->dev_addr); | 60 | br_fdb_changeaddr(p, dev->dev_addr); |
| 60 | br_stp_recalculate_bridge_id(br); | 61 | changed_addr = br_stp_recalculate_bridge_id(br); |
| 61 | spin_unlock_bh(&br->lock); | 62 | spin_unlock_bh(&br->lock); |
| 63 | |||
| 64 | if (changed_addr) | ||
| 65 | call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); | ||
| 66 | |||
| 62 | break; | 67 | break; |
| 63 | 68 | ||
| 64 | case NETDEV_CHANGE: | 69 | case NETDEV_CHANGE: |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 2b5ca1a0054d..5864cc491369 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
| @@ -1198,7 +1198,8 @@ ebt_register_table(struct net *net, const struct ebt_table *input_table) | |||
| 1198 | 1198 | ||
| 1199 | if (table->check && table->check(newinfo, table->valid_hooks)) { | 1199 | if (table->check && table->check(newinfo, table->valid_hooks)) { |
| 1200 | BUGPRINT("The table doesn't like its own initial data, lol\n"); | 1200 | BUGPRINT("The table doesn't like its own initial data, lol\n"); |
| 1201 | return ERR_PTR(-EINVAL); | 1201 | ret = -EINVAL; |
| 1202 | goto free_chainstack; | ||
| 1202 | } | 1203 | } |
| 1203 | 1204 | ||
| 1204 | table->private = newinfo; | 1205 | table->private = newinfo; |
diff --git a/net/core/scm.c b/net/core/scm.c index 4c1ef026d695..811b53fb330e 100644 --- a/net/core/scm.c +++ b/net/core/scm.c | |||
| @@ -192,7 +192,7 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p) | |||
| 192 | goto error; | 192 | goto error; |
| 193 | 193 | ||
| 194 | cred->uid = cred->euid = p->creds.uid; | 194 | cred->uid = cred->euid = p->creds.uid; |
| 195 | cred->gid = cred->egid = p->creds.uid; | 195 | cred->gid = cred->egid = p->creds.gid; |
| 196 | put_cred(p->cred); | 196 | put_cred(p->cred); |
| 197 | p->cred = cred; | 197 | p->cred = cred; |
| 198 | } | 198 | } |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 77d3eded665a..8c6563361ab5 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -122,6 +122,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb) | |||
| 122 | newskb->pkt_type = PACKET_LOOPBACK; | 122 | newskb->pkt_type = PACKET_LOOPBACK; |
| 123 | newskb->ip_summed = CHECKSUM_UNNECESSARY; | 123 | newskb->ip_summed = CHECKSUM_UNNECESSARY; |
| 124 | WARN_ON(!skb_dst(newskb)); | 124 | WARN_ON(!skb_dst(newskb)); |
| 125 | skb_dst_force(newskb); | ||
| 125 | netif_rx_ni(newskb); | 126 | netif_rx_ni(newskb); |
| 126 | return 0; | 127 | return 0; |
| 127 | } | 128 | } |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index ab0c9efd1efa..8905e92f896a 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -1067,7 +1067,7 @@ EXPORT_SYMBOL(compat_ip_setsockopt); | |||
| 1067 | */ | 1067 | */ |
| 1068 | 1068 | ||
| 1069 | static int do_ip_getsockopt(struct sock *sk, int level, int optname, | 1069 | static int do_ip_getsockopt(struct sock *sk, int level, int optname, |
| 1070 | char __user *optval, int __user *optlen) | 1070 | char __user *optval, int __user *optlen, unsigned flags) |
| 1071 | { | 1071 | { |
| 1072 | struct inet_sock *inet = inet_sk(sk); | 1072 | struct inet_sock *inet = inet_sk(sk); |
| 1073 | int val; | 1073 | int val; |
| @@ -1240,7 +1240,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 1240 | 1240 | ||
| 1241 | msg.msg_control = optval; | 1241 | msg.msg_control = optval; |
| 1242 | msg.msg_controllen = len; | 1242 | msg.msg_controllen = len; |
| 1243 | msg.msg_flags = 0; | 1243 | msg.msg_flags = flags; |
| 1244 | 1244 | ||
| 1245 | if (inet->cmsg_flags & IP_CMSG_PKTINFO) { | 1245 | if (inet->cmsg_flags & IP_CMSG_PKTINFO) { |
| 1246 | struct in_pktinfo info; | 1246 | struct in_pktinfo info; |
| @@ -1294,7 +1294,7 @@ int ip_getsockopt(struct sock *sk, int level, | |||
| 1294 | { | 1294 | { |
| 1295 | int err; | 1295 | int err; |
| 1296 | 1296 | ||
| 1297 | err = do_ip_getsockopt(sk, level, optname, optval, optlen); | 1297 | err = do_ip_getsockopt(sk, level, optname, optval, optlen, 0); |
| 1298 | #ifdef CONFIG_NETFILTER | 1298 | #ifdef CONFIG_NETFILTER |
| 1299 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1299 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1300 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && | 1300 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && |
| @@ -1327,7 +1327,8 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 1327 | return compat_mc_getsockopt(sk, level, optname, optval, optlen, | 1327 | return compat_mc_getsockopt(sk, level, optname, optval, optlen, |
| 1328 | ip_getsockopt); | 1328 | ip_getsockopt); |
| 1329 | 1329 | ||
| 1330 | err = do_ip_getsockopt(sk, level, optname, optval, optlen); | 1330 | err = do_ip_getsockopt(sk, level, optname, optval, optlen, |
| 1331 | MSG_CMSG_COMPAT); | ||
| 1331 | 1332 | ||
| 1332 | #ifdef CONFIG_NETFILTER | 1333 | #ifdef CONFIG_NETFILTER |
| 1333 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1334 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 2e97e3ec1eb7..929b27bdeb79 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
| @@ -18,17 +18,15 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
| 18 | struct rtable *rt; | 18 | struct rtable *rt; |
| 19 | struct flowi4 fl4 = {}; | 19 | struct flowi4 fl4 = {}; |
| 20 | __be32 saddr = iph->saddr; | 20 | __be32 saddr = iph->saddr; |
| 21 | __u8 flags = 0; | 21 | __u8 flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; |
| 22 | unsigned int hh_len; | 22 | unsigned int hh_len; |
| 23 | 23 | ||
| 24 | if (!skb->sk && addr_type != RTN_LOCAL) { | 24 | if (addr_type == RTN_UNSPEC) |
| 25 | if (addr_type == RTN_UNSPEC) | 25 | addr_type = inet_addr_type(net, saddr); |
| 26 | addr_type = inet_addr_type(net, saddr); | 26 | if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) |
| 27 | if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST) | 27 | flags |= FLOWI_FLAG_ANYSRC; |
| 28 | flags |= FLOWI_FLAG_ANYSRC; | 28 | else |
| 29 | else | 29 | saddr = 0; |
| 30 | saddr = 0; | ||
| 31 | } | ||
| 32 | 30 | ||
| 33 | /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause | 31 | /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause |
| 34 | * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. | 32 | * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. |
| @@ -38,7 +36,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
| 38 | fl4.flowi4_tos = RT_TOS(iph->tos); | 36 | fl4.flowi4_tos = RT_TOS(iph->tos); |
| 39 | fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; | 37 | fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; |
| 40 | fl4.flowi4_mark = skb->mark; | 38 | fl4.flowi4_mark = skb->mark; |
| 41 | fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags; | 39 | fl4.flowi4_flags = flags; |
| 42 | rt = ip_route_output_key(net, &fl4); | 40 | rt = ip_route_output_key(net, &fl4); |
| 43 | if (IS_ERR(rt)) | 41 | if (IS_ERR(rt)) |
| 44 | return -1; | 42 | return -1; |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 1457acb39cec..61714bd52925 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
| @@ -563,7 +563,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 563 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, | 563 | flowi4_init_output(&fl4, ipc.oif, sk->sk_mark, tos, |
| 564 | RT_SCOPE_UNIVERSE, | 564 | RT_SCOPE_UNIVERSE, |
| 565 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, | 565 | inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol, |
| 566 | FLOWI_FLAG_CAN_SLEEP, daddr, saddr, 0, 0); | 566 | inet_sk_flowi_flags(sk) | FLOWI_FLAG_CAN_SLEEP, |
| 567 | daddr, saddr, 0, 0); | ||
| 567 | 568 | ||
| 568 | if (!inet->hdrincl) { | 569 | if (!inet->hdrincl) { |
| 569 | err = raw_probe_proto_opt(&fl4, msg); | 570 | err = raw_probe_proto_opt(&fl4, msg); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e3dec1c9f09d..075212e41b83 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -722,7 +722,7 @@ static inline bool compare_hash_inputs(const struct rtable *rt1, | |||
| 722 | { | 722 | { |
| 723 | return ((((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) | | 723 | return ((((__force u32)rt1->rt_key_dst ^ (__force u32)rt2->rt_key_dst) | |
| 724 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | | 724 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | |
| 725 | (rt1->rt_iif ^ rt2->rt_iif)) == 0); | 725 | (rt1->rt_route_iif ^ rt2->rt_route_iif)) == 0); |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | static inline int compare_keys(struct rtable *rt1, struct rtable *rt2) | 728 | static inline int compare_keys(struct rtable *rt1, struct rtable *rt2) |
| @@ -731,8 +731,8 @@ static inline int compare_keys(struct rtable *rt1, struct rtable *rt2) | |||
| 731 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | | 731 | ((__force u32)rt1->rt_key_src ^ (__force u32)rt2->rt_key_src) | |
| 732 | (rt1->rt_mark ^ rt2->rt_mark) | | 732 | (rt1->rt_mark ^ rt2->rt_mark) | |
| 733 | (rt1->rt_key_tos ^ rt2->rt_key_tos) | | 733 | (rt1->rt_key_tos ^ rt2->rt_key_tos) | |
| 734 | (rt1->rt_oif ^ rt2->rt_oif) | | 734 | (rt1->rt_route_iif ^ rt2->rt_route_iif) | |
| 735 | (rt1->rt_iif ^ rt2->rt_iif)) == 0; | 735 | (rt1->rt_oif ^ rt2->rt_oif)) == 0; |
| 736 | } | 736 | } |
| 737 | 737 | ||
| 738 | static inline int compare_netns(struct rtable *rt1, struct rtable *rt2) | 738 | static inline int compare_netns(struct rtable *rt1, struct rtable *rt2) |
| @@ -2320,8 +2320,7 @@ int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 2320 | rth = rcu_dereference(rth->dst.rt_next)) { | 2320 | rth = rcu_dereference(rth->dst.rt_next)) { |
| 2321 | if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) | | 2321 | if ((((__force u32)rth->rt_key_dst ^ (__force u32)daddr) | |
| 2322 | ((__force u32)rth->rt_key_src ^ (__force u32)saddr) | | 2322 | ((__force u32)rth->rt_key_src ^ (__force u32)saddr) | |
| 2323 | (rth->rt_iif ^ iif) | | 2323 | (rth->rt_route_iif ^ iif) | |
| 2324 | rth->rt_oif | | ||
| 2325 | (rth->rt_key_tos ^ tos)) == 0 && | 2324 | (rth->rt_key_tos ^ tos)) == 0 && |
| 2326 | rth->rt_mark == skb->mark && | 2325 | rth->rt_mark == skb->mark && |
| 2327 | net_eq(dev_net(rth->dst.dev), net) && | 2326 | net_eq(dev_net(rth->dst.dev), net) && |
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 92bb9434b338..3bc5c8f7c71b 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c | |||
| @@ -276,7 +276,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | |||
| 276 | int mss; | 276 | int mss; |
| 277 | struct rtable *rt; | 277 | struct rtable *rt; |
| 278 | __u8 rcv_wscale; | 278 | __u8 rcv_wscale; |
| 279 | bool ecn_ok; | 279 | bool ecn_ok = false; |
| 280 | 280 | ||
| 281 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) | 281 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) |
| 282 | goto out; | 282 | goto out; |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 9cb191ecaba8..147ede38ab48 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
| @@ -913,7 +913,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt, | |||
| 913 | } | 913 | } |
| 914 | 914 | ||
| 915 | static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | 915 | static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, |
| 916 | char __user *optval, int __user *optlen) | 916 | char __user *optval, int __user *optlen, unsigned flags) |
| 917 | { | 917 | { |
| 918 | struct ipv6_pinfo *np = inet6_sk(sk); | 918 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 919 | int len; | 919 | int len; |
| @@ -962,7 +962,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
| 962 | 962 | ||
| 963 | msg.msg_control = optval; | 963 | msg.msg_control = optval; |
| 964 | msg.msg_controllen = len; | 964 | msg.msg_controllen = len; |
| 965 | msg.msg_flags = 0; | 965 | msg.msg_flags = flags; |
| 966 | 966 | ||
| 967 | lock_sock(sk); | 967 | lock_sock(sk); |
| 968 | skb = np->pktoptions; | 968 | skb = np->pktoptions; |
| @@ -1222,7 +1222,7 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
| 1222 | if(level != SOL_IPV6) | 1222 | if(level != SOL_IPV6) |
| 1223 | return -ENOPROTOOPT; | 1223 | return -ENOPROTOOPT; |
| 1224 | 1224 | ||
| 1225 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); | 1225 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen, 0); |
| 1226 | #ifdef CONFIG_NETFILTER | 1226 | #ifdef CONFIG_NETFILTER |
| 1227 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1227 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1228 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { | 1228 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { |
| @@ -1264,7 +1264,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
| 1264 | return compat_mc_getsockopt(sk, level, optname, optval, optlen, | 1264 | return compat_mc_getsockopt(sk, level, optname, optval, optlen, |
| 1265 | ipv6_getsockopt); | 1265 | ipv6_getsockopt); |
| 1266 | 1266 | ||
| 1267 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen); | 1267 | err = do_ipv6_getsockopt(sk, level, optname, optval, optlen, |
| 1268 | MSG_CMSG_COMPAT); | ||
| 1268 | #ifdef CONFIG_NETFILTER | 1269 | #ifdef CONFIG_NETFILTER |
| 1269 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1270 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1270 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { | 1271 | if (err == -ENOPROTOOPT && optname != IPV6_2292PKTOPTIONS) { |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 07bf1085458f..00b15ac7a702 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
| @@ -672,6 +672,9 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
| 672 | if (skb->protocol != htons(ETH_P_IPV6)) | 672 | if (skb->protocol != htons(ETH_P_IPV6)) |
| 673 | goto tx_error; | 673 | goto tx_error; |
| 674 | 674 | ||
| 675 | if (tos == 1) | ||
| 676 | tos = ipv6_get_dsfield(iph6); | ||
| 677 | |||
| 675 | /* ISATAP (RFC4214) - must come before 6to4 */ | 678 | /* ISATAP (RFC4214) - must come before 6to4 */ |
| 676 | if (dev->priv_flags & IFF_ISATAP) { | 679 | if (dev->priv_flags & IFF_ISATAP) { |
| 677 | struct neighbour *neigh = NULL; | 680 | struct neighbour *neigh = NULL; |
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 89d5bf806222..ac838965ff34 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
| @@ -165,7 +165,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
| 165 | int mss; | 165 | int mss; |
| 166 | struct dst_entry *dst; | 166 | struct dst_entry *dst; |
| 167 | __u8 rcv_wscale; | 167 | __u8 rcv_wscale; |
| 168 | bool ecn_ok; | 168 | bool ecn_ok = false; |
| 169 | 169 | ||
| 170 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) | 170 | if (!sysctl_tcp_syncookies || !th->ack || th->rst) |
| 171 | goto out; | 171 | goto out; |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index 5b466cd1272f..84d0fd47636a 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
| @@ -312,6 +312,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) | |||
| 312 | } | 312 | } |
| 313 | break; | 313 | break; |
| 314 | case NF_STOLEN: | 314 | case NF_STOLEN: |
| 315 | break; | ||
| 315 | default: | 316 | default: |
| 316 | kfree_skb(skb); | 317 | kfree_skb(skb); |
| 317 | } | 318 | } |
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 58107d060846..9c24de10a657 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c | |||
| @@ -341,11 +341,11 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 341 | 341 | ||
| 342 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); | 342 | entry = kzalloc(sizeof(*entry), GFP_ATOMIC); |
| 343 | if (entry == NULL) | 343 | if (entry == NULL) |
| 344 | return -ENOMEM; | 344 | goto out_entry; |
| 345 | if (domain != NULL) { | 345 | if (domain != NULL) { |
| 346 | entry->domain = kstrdup(domain, GFP_ATOMIC); | 346 | entry->domain = kstrdup(domain, GFP_ATOMIC); |
| 347 | if (entry->domain == NULL) | 347 | if (entry->domain == NULL) |
| 348 | goto cfg_cipsov4_map_add_failure; | 348 | goto out_domain; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | if (addr == NULL && mask == NULL) { | 351 | if (addr == NULL && mask == NULL) { |
| @@ -354,13 +354,13 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 354 | } else if (addr != NULL && mask != NULL) { | 354 | } else if (addr != NULL && mask != NULL) { |
| 355 | addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); | 355 | addrmap = kzalloc(sizeof(*addrmap), GFP_ATOMIC); |
| 356 | if (addrmap == NULL) | 356 | if (addrmap == NULL) |
| 357 | goto cfg_cipsov4_map_add_failure; | 357 | goto out_addrmap; |
| 358 | INIT_LIST_HEAD(&addrmap->list4); | 358 | INIT_LIST_HEAD(&addrmap->list4); |
| 359 | INIT_LIST_HEAD(&addrmap->list6); | 359 | INIT_LIST_HEAD(&addrmap->list6); |
| 360 | 360 | ||
| 361 | addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC); | 361 | addrinfo = kzalloc(sizeof(*addrinfo), GFP_ATOMIC); |
| 362 | if (addrinfo == NULL) | 362 | if (addrinfo == NULL) |
| 363 | goto cfg_cipsov4_map_add_failure; | 363 | goto out_addrinfo; |
| 364 | addrinfo->type_def.cipsov4 = doi_def; | 364 | addrinfo->type_def.cipsov4 = doi_def; |
| 365 | addrinfo->type = NETLBL_NLTYPE_CIPSOV4; | 365 | addrinfo->type = NETLBL_NLTYPE_CIPSOV4; |
| 366 | addrinfo->list.addr = addr->s_addr & mask->s_addr; | 366 | addrinfo->list.addr = addr->s_addr & mask->s_addr; |
| @@ -374,7 +374,7 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 374 | entry->type = NETLBL_NLTYPE_ADDRSELECT; | 374 | entry->type = NETLBL_NLTYPE_ADDRSELECT; |
| 375 | } else { | 375 | } else { |
| 376 | ret_val = -EINVAL; | 376 | ret_val = -EINVAL; |
| 377 | goto cfg_cipsov4_map_add_failure; | 377 | goto out_addrmap; |
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | ret_val = netlbl_domhsh_add(entry, audit_info); | 380 | ret_val = netlbl_domhsh_add(entry, audit_info); |
| @@ -384,11 +384,15 @@ int netlbl_cfg_cipsov4_map_add(u32 doi, | |||
| 384 | return 0; | 384 | return 0; |
| 385 | 385 | ||
| 386 | cfg_cipsov4_map_add_failure: | 386 | cfg_cipsov4_map_add_failure: |
| 387 | cipso_v4_doi_putdef(doi_def); | 387 | kfree(addrinfo); |
| 388 | out_addrinfo: | ||
| 389 | kfree(addrmap); | ||
| 390 | out_addrmap: | ||
| 388 | kfree(entry->domain); | 391 | kfree(entry->domain); |
| 392 | out_domain: | ||
| 389 | kfree(entry); | 393 | kfree(entry); |
| 390 | kfree(addrmap); | 394 | out_entry: |
| 391 | kfree(addrinfo); | 395 | cipso_v4_doi_putdef(doi_def); |
| 392 | return ret_val; | 396 | return ret_val; |
| 393 | } | 397 | } |
| 394 | 398 | ||
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 102fc212cd64..e051398fdf6b 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -196,8 +196,7 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, | |||
| 196 | 196 | ||
| 197 | skb2->skb_iif = skb->dev->ifindex; | 197 | skb2->skb_iif = skb->dev->ifindex; |
| 198 | skb2->dev = dev; | 198 | skb2->dev = dev; |
| 199 | dev_queue_xmit(skb2); | 199 | err = dev_queue_xmit(skb2); |
| 200 | err = 0; | ||
| 201 | 200 | ||
| 202 | out: | 201 | out: |
| 203 | if (err) { | 202 | if (err) { |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 2a318f2dc3e5..b5d56a22b1d2 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
| @@ -112,7 +112,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) | |||
| 112 | 112 | ||
| 113 | for (prio = 0; prio < q->bands; prio++) { | 113 | for (prio = 0; prio < q->bands; prio++) { |
| 114 | struct Qdisc *qdisc = q->queues[prio]; | 114 | struct Qdisc *qdisc = q->queues[prio]; |
| 115 | struct sk_buff *skb = qdisc->dequeue(qdisc); | 115 | struct sk_buff *skb = qdisc_dequeue_peeked(qdisc); |
| 116 | if (skb) { | 116 | if (skb) { |
| 117 | qdisc_bstats_update(sch, skb); | 117 | qdisc_bstats_update(sch, skb); |
| 118 | sch->q.qlen--; | 118 | sch->q.qlen--; |
