All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR
@ 2021-01-28 15:24 Alejandro Colomar
  2021-01-28 15:24 ` [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch Alejandro Colomar
  0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2021-01-28 15:24 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Pali Rohár, linux-man, Dmitry V . Levin, netdev, Alejandro Colomar

From: Pali Rohár <pali@kernel.org>

Unlike SIOCGIFADDR and SIOCSIFADDR which are supported by many protocol
families, SIOCDIFADDR is supported by AF_INET6 and AF_APPLETALK only.

Unlike other protocols, AF_INET6 uses struct in6_ifreq.

Cc: Dmitry V. Levin <ldv@altlinux.org>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/netdevice.7 | 64 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 55 insertions(+), 9 deletions(-)

diff --git a/man7/netdevice.7 b/man7/netdevice.7
index 15930807c..bdc2d1922 100644
--- a/man7/netdevice.7
+++ b/man7/netdevice.7
@@ -56,9 +56,27 @@ struct ifreq {
 .EE
 .in
 .PP
+.B AF_INET6
+is an exception.
+It passes an
+.I in6_ifreq
+structure:
+.PP
+.in +4n
+.EX
+struct in6_ifreq {
+    struct in6_addr     ifr6_addr;
+    u32                 ifr6_prefixlen;
+    int                 ifr6_ifindex; /* Interface index */
+};
+.EE
+.in
+.PP
 Normally, the user specifies which device to affect by setting
 .I ifr_name
-to the name of the interface.
+to the name of the interface or
+.I ifr6_ifindex
+to the index of the interface.
 All other members of the structure may
 share memory.
 .SS Ioctls
@@ -143,13 +161,33 @@ IFF_ISATAP:Interface is RFC4214 ISATAP interface.
 .PP
 Setting the extended (private) interface flags is a privileged operation.
 .TP
-.BR SIOCGIFADDR ", " SIOCSIFADDR
-Get or set the address of the device using
-.IR ifr_addr .
-Setting the interface address is a privileged operation.
-For compatibility, only
+.BR SIOCGIFADDR ", " SIOCSIFADDR ", " SIOCDIFADDR
+Get, set, or delete the address of the device using
+.IR ifr_addr ,
+or
+.I ifr6_addr
+with
+.IR ifr6_prefixlen .
+Setting or deleting the interface address is a privileged operation.
+For compatibility,
+.B SIOCGIFADDR
+returns only
 .B AF_INET
-addresses are accepted or returned.
+addresses,
+.B SIOCSIFADDR
+accepts
+.B AF_INET
+and
+.B AF_INET6
+addresses, and
+.B SIOCDIFADDR
+deletes only
+.B AF_INET6
+addresses.
+A
+.B AF_INET
+address can be deleted by setting it to zero via
+.BR SIOCSIFADDR .
 .TP
 .BR SIOCGIFDSTADDR ", " SIOCSIFDSTADDR
 Get or set the destination address of a point-to-point device using
@@ -351,10 +389,18 @@ The names of interfaces with no addresses or that don't have the
 flag set can be found via
 .IR /proc/net/dev .
 .PP
-Local IPv6 IP addresses can be found via
-.I /proc/net
+.B AF_INET6
+IPv6 addresses can be read from
+.I /proc/net/if_inet6
+file or via
+.BR rtnetlink (7).
+Adding a new or deleting an existing IPv6 address can be done via
+.BR SIOCSIFADDR " / " SIOCDIFADDR
 or via
 .BR rtnetlink (7).
+Retrieving or changing destination IPv6 addresses of a point-to-point
+interface is possible only via
+.BR rtnetlink (7).
 .SH BUGS
 glibc 2.1 is missing the
 .I ifr_newname
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-01-28 15:24 [PATCH 1/2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR Alejandro Colomar
@ 2021-01-28 15:24 ` Alejandro Colomar
  2021-01-28 20:16   ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar @ 2021-01-28 15:24 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, pali, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/netdevice.7 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man7/netdevice.7 b/man7/netdevice.7
index bdc2d1922..4acf05c10 100644
--- a/man7/netdevice.7
+++ b/man7/netdevice.7
@@ -390,12 +390,12 @@ flag set can be found via
 .IR /proc/net/dev .
 .PP
 .B AF_INET6
-IPv6 addresses can be read from
+IPv6 addresses can be read in
 .I /proc/net/if_inet6
-file or via
+or via
 .BR rtnetlink (7).
 Adding a new or deleting an existing IPv6 address can be done via
-.BR SIOCSIFADDR " / " SIOCDIFADDR
+.BR SIOCSIFADDR / SIOCDIFADDR
 or via
 .BR rtnetlink (7).
 Retrieving or changing destination IPv6 addresses of a point-to-point
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-01-28 15:24 ` [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch Alejandro Colomar
@ 2021-01-28 20:16   ` Michael Kerrisk (man-pages)
  2021-02-07 11:18     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-01-28 20:16 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, pali, linux-man

Hi Alex,

On 1/28/21 4:24 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man7/netdevice.7 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/man7/netdevice.7 b/man7/netdevice.7
> index bdc2d1922..4acf05c10 100644
> --- a/man7/netdevice.7
> +++ b/man7/netdevice.7
> @@ -390,12 +390,12 @@ flag set can be found via
>  .IR /proc/net/dev .
>  .PP
>  .B AF_INET6
> -IPv6 addresses can be read from
> +IPv6 addresses can be read in
>  .I /proc/net/if_inet6
> -file or via
> +or via

I made a different fix. "read from" is a little better than
"read in", but it needs to be either "read from the ... file"
or "read from ...". I chose the latter.

Thanks,

Michael


>  .BR rtnetlink (7).
>  Adding a new or deleting an existing IPv6 address can be done via
> -.BR SIOCSIFADDR " / " SIOCDIFADDR
> +.BR SIOCSIFADDR / SIOCDIFADDR
>  or via
>  .BR rtnetlink (7).
>  Retrieving or changing destination IPv6 addresses of a point-to-point
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-01-28 20:16   ` Michael Kerrisk (man-pages)
@ 2021-02-07 11:18     ` Alejandro Colomar (man-pages)
  2021-02-09 19:29       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-02-07 11:18 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: pali, linux-man

Hi Michael,

On 1/28/21 9:16 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 1/28/21 4:24 PM, Alejandro Colomar wrote:
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>  man7/netdevice.7 | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/man7/netdevice.7 b/man7/netdevice.7
>> index bdc2d1922..4acf05c10 100644
>> --- a/man7/netdevice.7
>> +++ b/man7/netdevice.7
>> @@ -390,12 +390,12 @@ flag set can be found via
>>  .IR /proc/net/dev .
>>  .PP
>>  .B AF_INET6
>> -IPv6 addresses can be read from
>> +IPv6 addresses can be read in
>>  .I /proc/net/if_inet6
>> -file or via
>> +or via
> 
> I made a different fix. "read from" is a little better than
> "read in", but it needs to be either "read from the ... file"
> or "read from ...". I chose the latter.
> 
> Thanks,
> 
> Michael
> 
> 
>>  .BR rtnetlink (7).
>>  Adding a new or deleting an existing IPv6 address can be done via
>> -.BR SIOCSIFADDR " / " SIOCDIFADDR
>> +.BR SIOCSIFADDR / SIOCDIFADDR

I noticed you didn't apply this part.  Did you forget it, or do you
prefer it as is?

Rationale:

https://lore.kernel.org/linux-man/fc4a94d4-2eac-1b24-cc90-162045eae107@gmail.com/

Thanks,

Alex

>>  or via
>>  .BR rtnetlink (7).
>>  Retrieving or changing destination IPv6 addresses of a point-to-point
>>
> 
> 

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-02-07 11:18     ` Alejandro Colomar (man-pages)
@ 2021-02-09 19:29       ` Michael Kerrisk (man-pages)
  2021-02-09 19:37         ` Pali Rohár
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-09 19:29 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, pali, linux-man

Hi Alex,

On 2/7/21 12:18 PM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> On 1/28/21 9:16 PM, Michael Kerrisk (man-pages) wrote:

[...]

>>>  .BR rtnetlink (7).
>>>  Adding a new or deleting an existing IPv6 address can be done via
>>> -.BR SIOCSIFADDR " / " SIOCDIFADDR
>>> +.BR SIOCSIFADDR / SIOCDIFADDR
> 
> I noticed you didn't apply this part.  Did you forget it, or do you
> prefer it as is?
> 
> Rationale:
> 
> https://lore.kernel.org/linux-man/fc4a94d4-2eac-1b24-cc90-162045eae107@gmail.com/

I'm not sure, but overall I did not/do like the sentence structure.
I applied the patch below.

Cheers,

Michael

--- a/man7/netdevice.7
+++ b/man7/netdevice.7
@@ -394,8 +394,11 @@ IPv6 addresses can be read from
 .I /proc/net/if_inet6
 or via
 .BR rtnetlink (7).
-Adding a new or deleting an existing IPv6 address can be done via
-.BR SIOCSIFADDR " / " SIOCDIFADDR
+Adding a new IPv6 address and deleting an existing IPv6 address
+can be done via
+.B SIOCSIFADDRi
+and
+.B SIOCDIFADDR
 or via
 .BR rtnetlink (7).
 Retrieving or changing destination IPv6 addresses of a point-to-point



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-02-09 19:29       ` Michael Kerrisk (man-pages)
@ 2021-02-09 19:37         ` Pali Rohár
  2021-02-09 20:59           ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 7+ messages in thread
From: Pali Rohár @ 2021-02-09 19:37 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: Alejandro Colomar (man-pages), linux-man

On Tuesday 09 February 2021 20:29:45 Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 2/7/21 12:18 PM, Alejandro Colomar (man-pages) wrote:
> > Hi Michael,
> > 
> > On 1/28/21 9:16 PM, Michael Kerrisk (man-pages) wrote:
> 
> [...]
> 
> >>>  .BR rtnetlink (7).
> >>>  Adding a new or deleting an existing IPv6 address can be done via
> >>> -.BR SIOCSIFADDR " / " SIOCDIFADDR
> >>> +.BR SIOCSIFADDR / SIOCDIFADDR
> > 
> > I noticed you didn't apply this part.  Did you forget it, or do you
> > prefer it as is?
> > 
> > Rationale:
> > 
> > https://lore.kernel.org/linux-man/fc4a94d4-2eac-1b24-cc90-162045eae107@gmail.com/
> 
> I'm not sure, but overall I did not/do like the sentence structure.
> I applied the patch below.
> 
> Cheers,
> 
> Michael
> 
> --- a/man7/netdevice.7
> +++ b/man7/netdevice.7
> @@ -394,8 +394,11 @@ IPv6 addresses can be read from
>  .I /proc/net/if_inet6
>  or via
>  .BR rtnetlink (7).
> -Adding a new or deleting an existing IPv6 address can be done via
> -.BR SIOCSIFADDR " / " SIOCDIFADDR
> +Adding a new IPv6 address and deleting an existing IPv6 address
> +can be done via
> +.B SIOCSIFADDRi

Hello Michael! There is an extra 'i'.

> +and
> +.B SIOCDIFADDR
>  or via
>  .BR rtnetlink (7).
>  Retrieving or changing destination IPv6 addresses of a point-to-point

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch
  2021-02-09 19:37         ` Pali Rohár
@ 2021-02-09 20:59           ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-09 20:59 UTC (permalink / raw)
  To: Pali Rohár; +Cc: mtk.manpages, Alejandro Colomar (man-pages), linux-man

On 2/9/21 8:37 PM, Pali Rohár wrote:
> On Tuesday 09 February 2021 20:29:45 Michael Kerrisk (man-pages) wrote:
>> Hi Alex,
>>
>> On 2/7/21 12:18 PM, Alejandro Colomar (man-pages) wrote:
>>> Hi Michael,
>>>
>>> On 1/28/21 9:16 PM, Michael Kerrisk (man-pages) wrote:
>>
>> [...]
>>
>>>>>  .BR rtnetlink (7).
>>>>>  Adding a new or deleting an existing IPv6 address can be done via
>>>>> -.BR SIOCSIFADDR " / " SIOCDIFADDR
>>>>> +.BR SIOCSIFADDR / SIOCDIFADDR
>>>
>>> I noticed you didn't apply this part.  Did you forget it, or do you
>>> prefer it as is?
>>>
>>> Rationale:
>>>
>>> https://lore.kernel.org/linux-man/fc4a94d4-2eac-1b24-cc90-162045eae107@gmail.com/
>>
>> I'm not sure, but overall I did not/do like the sentence structure.
>> I applied the patch below.
>>
>> Cheers,
>>
>> Michael
>>
>> --- a/man7/netdevice.7
>> +++ b/man7/netdevice.7
>> @@ -394,8 +394,11 @@ IPv6 addresses can be read from
>>  .I /proc/net/if_inet6
>>  or via
>>  .BR rtnetlink (7).
>> -Adding a new or deleting an existing IPv6 address can be done via
>> -.BR SIOCSIFADDR " / " SIOCDIFADDR
>> +Adding a new IPv6 address and deleting an existing IPv6 address
>> +can be done via
>> +.B SIOCSIFADDRi
> 
> Hello Michael! There is an extra 'i'.

Thanks, Pali! Fixed.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-09 21:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 15:24 [PATCH 1/2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR Alejandro Colomar
2021-01-28 15:24 ` [PATCH 2/2] netdevice.7: Minor fixes to Pali's patch Alejandro Colomar
2021-01-28 20:16   ` Michael Kerrisk (man-pages)
2021-02-07 11:18     ` Alejandro Colomar (man-pages)
2021-02-09 19:29       ` Michael Kerrisk (man-pages)
2021-02-09 19:37         ` Pali Rohár
2021-02-09 20:59           ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.