tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: IPv4 Address Flags



On 23/04/2015 10:39, Roy Marples wrote:
> On 23/04/2015 09:51, Joerg Sonnenberger wrote:
>> On Wed, Apr 22, 2015 at 03:42:01PM -0700, Matt Thomas wrote:
>>>
>>>> On Apr 22, 2015, at 3:24 PM, Christos Zoulas <christos%astron.com@localhost> wrote:
>>>>
>>>> In article <55381013.6070403%marples.name@localhost>,
>>>> Roy Marples  <roy%marples.name@localhost> wrote:
>>>>> diff -u -r1.188 if.h
>>>>> --- sys/net/if.h	20 Apr 2015 10:19:54 -0000	1.188
>>>>> +++ sys/net/if.h	22 Apr 2015 21:03:01 -0000
>>>>> @@ -594,6 +594,7 @@
>>>>> 		struct	sockaddr ifru_broadaddr;
>>>>> 		struct	sockaddr_storage ifru_space;
>>>>> 		short	ifru_flags;
>>>>> +		int	ifru_addrflags;
>>>>> 		int	ifru_metric;
>>>>
>>>> This is an ABI change to all ifreq ioctls... If you are going to do this,
>>>> I'd bite the bullet and bump sockaddr_storage to 256 or 512 bytes and get
>>>> rid of sockaddr_big.
>>>
>>> Not really since that’s in a union.
>>>
>>> No ABI change.
>>
>> It is an ABI change as the offset of ifru_metric changes?
> 
> #include <net/if.h>
> #include <stddef.h>
> #include <stdio.h>
> 
> int main(void)
> {
> 
> 	printf ("flags offset %lu\n", offsetof(struct ifreq, ifr_flags));
> 	printf ("addrflags offset %lu\n", offsetof(struct ifreq, ifr_addrflags));
> 	printf ("metric offset %lu\n", offsetof(struct ifreq, ifr_addrflags));
> 	return 0;
> }
> 
> outputs:
> flags offset 16
> addrflags offset 16
> metric offset 16
> 
> How is this an ABI change?

New version, fixes prior copynpasta

 #include <net/if.h>
 #include <stddef.h>
 #include <stdio.h>

 int main(void)
 {

 	printf ("flags offset %lu\n", offsetof(struct ifreq, ifr_flags));
 	printf ("addrflags offset %lu\n", offsetof(struct ifreq, ifr_addrflags));
 	printf ("metric offset %lu\n", offsetof(struct ifreq, ifr_metric));

 	printf ("flags offset %lu\n", offsetof(struct ifreq,
ifr_ifru.ifru_flags));
 	printf ("addrflags offset %lu\n", offsetof(struct ifreq,
ifr_ifru.ifru_addrflags));
 	printf ("metric offset %lu\n", offsetof(struct ifreq,
ifr_ifru.ifru_metric));
 	return 0;
 }

outputs:
flags offset 16
addrflags offset 16
metric offset 16
flags offset 16
addrflags offset 16
metric offset 16

How is this an ABI change?

Roy


Home | Main Index | Thread Index | Old Index