Skip to content

Commit 5578689

Browse files
Daniel Lezcanodavem330
authored andcommitted
[NETNS][IPV6] route6 - make route6 per namespace
This patch makes the routing engine use the network namespaces to access routing informations: Add a network namespace parameter to ipv6_route_ioctl and propagate the network namespace value to all the routing code that have not yet been changed. Signed-off-by: Daniel Lezcano <[email protected]> Signed-off-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7b4da53 commit 5578689

File tree

3 files changed

+54
-51
lines changed

3 files changed

+54
-51
lines changed

include/net/ip6_route.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ extern struct dst_entry * ip6_route_output(struct sock *sk,
4949
extern int ip6_route_init(void);
5050
extern void ip6_route_cleanup(void);
5151

52-
extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg);
52+
extern int ipv6_route_ioctl(struct net *net,
53+
unsigned int cmd,
54+
void __user *arg);
5355

5456
extern int ip6_route_add(struct fib6_config *cfg);
5557
extern int ip6_ins_rt(struct rt6_info *);

net/ipv6/af_inet6.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ EXPORT_SYMBOL(inet6_getname);
440440
int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
441441
{
442442
struct sock *sk = sock->sk;
443+
struct net *net = sk->sk_net;
443444

444445
switch(cmd)
445446
{
@@ -452,7 +453,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
452453
case SIOCADDRT:
453454
case SIOCDELRT:
454455

455-
return(ipv6_route_ioctl(cmd,(void __user *)arg));
456+
return(ipv6_route_ioctl(net, cmd, (void __user *)arg));
456457

457458
case SIOCSIFADDR:
458459
return addrconf_add_ifaddr((void __user *) arg);

0 commit comments

Comments
 (0)