Merge branch 'halasa-hdlc' of git://git.tuxdriver.com/git/netdev-jwl
[powerpc.git] / net / ipv6 / ipv6_sockglue.c
index dc1d991..25757ad 100644 (file)
@@ -80,8 +80,7 @@ int ip6_ra_control(struct sock *sk, int sel, void (*destructor)(struct sock *))
                if (ra->sk == sk) {
                        if (sel>=0) {
                                write_unlock_bh(&ip6_ra_lock);
-                               if (new_ra)
-                                       kfree(new_ra);
+                               kfree(new_ra);
                                return -EADDRINUSE;
                        }
 
@@ -264,6 +263,18 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
                retv = 0;
                break;
 
+       case IPV6_TCLASS:
+               if (val < 0 || val > 0xff)
+                       goto e_inval;
+               np->tclass = val;
+               retv = 0;
+               break;
+               
+       case IPV6_RECVTCLASS:
+               np->rxopt.bits.rxtclass = valbool;
+               retv = 0;
+               break;
+
        case IPV6_FLOWINFO:
                np->rxopt.bits.rxflow = valbool;
                retv = 0;
@@ -276,7 +287,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
        {
                struct ipv6_txoptions *opt;
                if (optlen == 0)
-                       optval = 0;
+                       optval = NULL;
 
                /* hop-by-hop / destination options are privileged option */
                retv = -EPERM;
@@ -364,7 +375,7 @@ sticky_done:
                msg.msg_controllen = optlen;
                msg.msg_control = (void*)(opt+1);
 
-               retv = datagram_send_ctl(&msg, &fl, opt, &junk);
+               retv = datagram_send_ctl(&msg, &fl, opt, &junk, &junk);
                if (retv)
                        goto done;
 update:
@@ -787,6 +798,14 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
                val = np->rxopt.bits.odstopts;
                break;
 
+       case IPV6_TCLASS:
+               val = np->tclass;
+               break;
+
+       case IPV6_RECVTCLASS:
+               val = np->rxopt.bits.rxtclass;
+               break;
+
        case IPV6_FLOWINFO:
                val = np->rxopt.bits.rxflow;
                break;