Re: [PATCH 1/2] Decode setsockopt() multicast arguments

2015-05-26 Thread Ben Noordhuis
On Tue, May 26, 2015 at 4:26 PM, Dmitry V. Levin wrote: > On Sat, Feb 07, 2015 at 08:17:46PM +0300, Dmitry V. Levin wrote: >> On Sat, Feb 07, 2015 at 06:05:56PM +0100, Ben Noordhuis wrote: >> > On Sat, Feb 7, 2015 at 12:55 AM, Dmitry V. Levin wrote: >> > > On Thu, Feb 05, 2015 at 07:28:45PM +0100,

Re: [PATCH 1/2] Decode setsockopt() multicast arguments

2015-05-26 Thread Dmitry V. Levin
On Sat, Feb 07, 2015 at 08:17:46PM +0300, Dmitry V. Levin wrote: > On Sat, Feb 07, 2015 at 06:05:56PM +0100, Ben Noordhuis wrote: > > On Sat, Feb 7, 2015 at 12:55 AM, Dmitry V. Levin wrote: > > > On Thu, Feb 05, 2015 at 07:28:45PM +0100, Ben Noordhuis wrote: > > >> +#ifdef IP_ADD_MEMBERSHIP > > >>

Re: [PATCH 1/2] Decode setsockopt() multicast arguments

2015-02-07 Thread Ben Noordhuis
On Sat, Feb 7, 2015 at 12:55 AM, Dmitry V. Levin wrote: > On Thu, Feb 05, 2015 at 07:28:45PM +0100, Ben Noordhuis wrote: >> +#ifdef IP_ADD_MEMBERSHIP >> +static void >> +print_mreq(struct tcb *tcp, long addr, int len) >> +{ >> + struct ip_mreq mreq; >> + if (len == sizeof(mreq) && umove(tc

Re: [PATCH 1/2] Decode setsockopt() multicast arguments

2015-02-07 Thread Dmitry V. Levin
On Sat, Feb 07, 2015 at 06:05:56PM +0100, Ben Noordhuis wrote: > On Sat, Feb 7, 2015 at 12:55 AM, Dmitry V. Levin wrote: > > On Thu, Feb 05, 2015 at 07:28:45PM +0100, Ben Noordhuis wrote: > >> +#ifdef IP_ADD_MEMBERSHIP > >> +static void > >> +print_mreq(struct tcb *tcp, long addr, int len) > >> +{

Re: [PATCH 1/2] Decode setsockopt() multicast arguments

2015-02-06 Thread Dmitry V. Levin
On Thu, Feb 05, 2015 at 07:28:45PM +0100, Ben Noordhuis wrote: > A small test program follows: > > #include > #include > #include > #include > > int main(void) { > int fd; > struct ip_mreq m4; > struct ipv6_mreq m6; > fd = socket(AF_INET6, SOCK_DGRAM, 0); > inet_

Decode setsockopt() multicast arguments

2015-02-05 Thread Ben Noordhuis
The first patch makes the setsockopt() option parser aware of IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP and its IPv6 variants. It also fixes a minor fall-through bug in the SOL_IP switch case. The second patch reduces the line count in net.c a little by reusing a function that is introduced in the

[PATCH 1/2] Decode setsockopt() multicast arguments

2015-02-05 Thread Ben Noordhuis
A small test program follows: #include #include #include #include int main(void) { int fd; struct ip_mreq m4; struct ipv6_mreq m6; fd = socket(AF_INET6, SOCK_DGRAM, 0); inet_aton("224.0.0.2", &m4.imr_multiaddr); inet_aton("0.0.0.0", &m4.imr_interface); in

Re: [PATCH] Decode setsockopt() multicast arguments

2014-03-18 Thread Dmitry V. Levin
On Mon, Mar 17, 2014 at 07:24:00PM +0100, Ben Noordhuis wrote: > * net.c (sys_setsockopt): decode IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, > IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP arguments. Thanks. > --- a/net.c > +++ b/net.c > @@ -2301,6 +2301,49 @@ static void printicmpfilter(struct tcb

Re: [PATCH] Decode setsockopt() multicast arguments

2014-03-18 Thread Philippe Ombredanne
On Mon, Mar 17, 2014 at 7:24 PM, Ben Noordhuis wrote: > A small test program follows: > > #include > #include > #include > #include > > int main(void) { > int fd; > struct ip_mreq m4; > struct ipv6_mreq m6; > fd = socket(AF_INET6, SOCK_DGRAM, 0); > inet_aton("224.

[PATCH] Decode setsockopt() multicast arguments

2014-03-17 Thread Ben Noordhuis
A small test program follows: #include #include #include #include int main(void) { int fd; struct ip_mreq m4; struct ipv6_mreq m6; fd = socket(AF_INET6, SOCK_DGRAM, 0); inet_aton("224.0.0.2", &m4.imr_multiaddr); inet_aton("0.0.0.0", &m4.imr_interface); in