diff options
-rw-r--r-- | drivers/net/ipvlan/ipvlan.h | 1 | ||||
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index 9542b7bac61a..817cab1a7959 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h | |||
@@ -115,7 +115,6 @@ static inline struct ipvl_port *ipvlan_port_get_rtnl(const struct net_device *d) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev); | 117 | void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev); |
118 | void ipvlan_set_port_mode(struct ipvl_port *port, u32 nval); | ||
119 | void ipvlan_init_secret(void); | 118 | void ipvlan_init_secret(void); |
120 | unsigned int ipvlan_mac_hash(const unsigned char *addr); | 119 | unsigned int ipvlan_mac_hash(const unsigned char *addr); |
121 | rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb); | 120 | rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb); |
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 7a3b41468a55..5bcb852c5500 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -14,7 +14,7 @@ void ipvlan_adjust_mtu(struct ipvl_dev *ipvlan, struct net_device *dev) | |||
14 | ipvlan->dev->mtu = dev->mtu - ipvlan->mtu_adj; | 14 | ipvlan->dev->mtu = dev->mtu - ipvlan->mtu_adj; |
15 | } | 15 | } |
16 | 16 | ||
17 | void ipvlan_set_port_mode(struct ipvl_port *port, u32 nval) | 17 | static void ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) |
18 | { | 18 | { |
19 | struct ipvl_dev *ipvlan; | 19 | struct ipvl_dev *ipvlan; |
20 | 20 | ||
@@ -442,6 +442,7 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
442 | struct ipvl_port *port; | 442 | struct ipvl_port *port; |
443 | struct net_device *phy_dev; | 443 | struct net_device *phy_dev; |
444 | int err; | 444 | int err; |
445 | u16 mode = IPVLAN_MODE_L3; | ||
445 | 446 | ||
446 | if (!tb[IFLA_LINK]) | 447 | if (!tb[IFLA_LINK]) |
447 | return -EINVAL; | 448 | return -EINVAL; |
@@ -460,10 +461,10 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
460 | return err; | 461 | return err; |
461 | } | 462 | } |
462 | 463 | ||
463 | port = ipvlan_port_get_rtnl(phy_dev); | ||
464 | if (data && data[IFLA_IPVLAN_MODE]) | 464 | if (data && data[IFLA_IPVLAN_MODE]) |
465 | port->mode = nla_get_u16(data[IFLA_IPVLAN_MODE]); | 465 | mode = nla_get_u16(data[IFLA_IPVLAN_MODE]); |
466 | 466 | ||
467 | port = ipvlan_port_get_rtnl(phy_dev); | ||
467 | ipvlan->phy_dev = phy_dev; | 468 | ipvlan->phy_dev = phy_dev; |
468 | ipvlan->dev = dev; | 469 | ipvlan->dev = dev; |
469 | ipvlan->port = port; | 470 | ipvlan->port = port; |
@@ -489,6 +490,8 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, | |||
489 | goto ipvlan_destroy_port; | 490 | goto ipvlan_destroy_port; |
490 | 491 | ||
491 | list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); | 492 | list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans); |
493 | ipvlan_set_port_mode(port, mode); | ||
494 | |||
492 | netif_stacked_transfer_operstate(phy_dev, dev); | 495 | netif_stacked_transfer_operstate(phy_dev, dev); |
493 | return 0; | 496 | return 0; |
494 | 497 | ||