[PATCH] rtnetlink.7: Remove IPv4 from description

2021-01-16 Thread Alejandro Colomar
From: Pali Rohár 

rtnetlink is not only used for IPv4

Signed-off-by: Pali Rohár 
Signed-off-by: Alejandro Colomar 
---
 man7/rtnetlink.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/rtnetlink.7 b/man7/rtnetlink.7
index cd6809320..aec005ff9 100644
--- a/man7/rtnetlink.7
+++ b/man7/rtnetlink.7
@@ -13,7 +13,7 @@
 .\"
 .TH RTNETLINK  7 2020-06-09 "Linux" "Linux Programmer's Manual"
 .SH NAME
-rtnetlink \- Linux IPv4 routing socket
+rtnetlink \- Linux routing socket
 .SH SYNOPSIS
 .nf
 .B #include 
-- 
2.30.0



[PATCH 1/2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-28 Thread Alejandro Colomar
From: Pali Rohár 

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 
Cc: 
Signed-off-by: Pali Rohár 
Signed-off-by: Alejandro Colomar 
---
 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



Re: [GIT] Networking

2020-09-12 Thread Alejandro Colomar
On Thu, Sep 3, 2015 at 11:31 AM, Linus Torvalds
 wrote:

 >> [-Wsizeof-array-argument]

 > Ahh. Google shows that it's an old clang warning that gcc has recently
 > picked up.

 > But even clang doesn't seem to have any way for a project to say
 > "please warn about arrays in function argument declaration". It *is*
 > very traditional idiomatic C, it's just that I personally think it's
 > one of those bad traditional C things exactly because it's so
 > misleading about what actually goes on. But I guess that in practice,
 > the only thing that it actually *affects* is "sizeof" (and assignment
 > to the variable name - something that would be invalid for a real
 > array, but works on argument arrays because they are really just
 > pointers).

 > The "array as function argument" syntax is occasionally useful
 > (particularly for the multi-dimensional array case), so I very much
 > understand why it exists, I just think that in the kernel we'd be
 > better off with the rule that it's against our coding practices.

 >   Linus


Hi Linus,

First of all, this is my first message to this mailing list, and I'm
trying to reply to a very old thread, so sorry if I don't know how/if I
should do it.

I have a different approach in my code to avoid that whole class of bugs
relating sizeof and false arrays in function argument declarations.
I do like the sintactic sugar that they provide, so I decided to ban
"sizeof(array)" completely off my code.

I have developed the following macro:

#define ARRAY_BYTES(arr)(sizeof((arr)[0]) * ARRAY_SIZE(arr))

which compiles to a simple "sizeof(arr)" by undoing the division in
"ARRAY_SIZE()", but with the added benefit that it checks that the
argument is an array (due to "ARRAY_SIZE()"), and if not, compilation
breaks which means that the array is not an array but a pointer.

My rules are:

  - Size of an array (number of elements):
ARRAY_SIZE(arr)
  - Signed size of an array (normally for loops where I compare against a
  signed variable):
ARRAY_SSIZE(arr)defined as: ((ptrdiff_t)ARRAY_SIZE(arr))
  - Size of an array in bytes (normally for buffers):
ARRAY_BYTES(arr)

No use of "sizeof" is allowed for arrays, which completely rules
out bugs of that class, because I never pass an array to "sizeof", which
is the core of the problem.  I've been using those macros in my code for
more than a year, and they work really nice.

I propose to include the macro "ARRAY_BYTES()" in  just
after "ARRAY_SIZE()" and replace every appearance of "sizeof(array)" in
Linux by "ARRAY_BYTES(array)", and modify the coding style guide to ban
"sizeof(array)" completely off the kernel.

Below are two patches:  one that adds the macro to
, and another one that serves as an example of usage
for the macro (that one is just as an example).

I don't intend those patches to be applied directly, but instead to
be an example of what I mean.  If you think the change is good, then
I'll prepare a big patch set for all of the appearances of sizeof()
that are unsafe :)


Cheers,

Alex.


Please CC me  in any response to this thread.

 From b5b674d39b28e703300698fa63e4ab4be646df8f Mon Sep 17 00:00:00 2001
From: Alejandro Colomar 
Date: Sun, 5 Apr 2020 01:45:35 +0200
Subject: [PATCH 1/2] linux/kernel.h: add ARRAY_BYTES() macro

Signed-off-by: Alejandro Colomar 
---
  include/linux/kernel.h | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 9b7a8d74a9d6..dc806e2a7799 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -46,6 +46,12 @@
   */
  #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) +
__must_be_array(arr))

+/**
+ * ARRAY_BYTES - get the number of bytes in array @arr
+ * @arr: array to be sized
+ */
+#define ARRAY_BYTES(arr)   (sizeof(arr) + __must_be_array(arr))
+
  #define u64_to_user_ptr(x) (  \
  {     \
typecheck(u64, (x));\
-- 
2.25.1

--------
 From 3e7bcf70b708b51a7807c336c5d1b01403989d3b Mon Sep 17 00:00:00 2001
From: Alejandro Colomar 
Date: Sun, 5 Apr 2020 01:48:17 +0200
Subject: [PATCH 2/2] block, bfq: Use ARRAY_BYTES() for arrays instead of
  sizeof()

Signed-off-by: Alejandro Colomar 
---
  block/bfq-cgroup.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 68882b9b8f11..51ba9b9a8855 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -7,6 +7,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 

Re: [PATCH v2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-15 Thread Alejandro Colomar (man-pages)
On 1/12/21 8:26 PM, Pali Rohár wrote:
> On Sunday 10 January 2021 20:57:50 Alejandro Colomar (man-pages) wrote:
>> [ CC += netdev ]
>>
>> On 1/10/21 5:38 PM, Pali Rohár wrote:
>>> On Saturday 02 January 2021 19:39:52 Pali Rohár wrote:
>>>> Also add description for struct in6_ifreq which is used for IPv6 addresses.
>>>>
>>>> SIOCSIFADDR and SIOCDIFADDR can be used to add or delete IPv6 address and
>>>> pppd is using these ioctls for a long time. Surprisingly SIOCDIFADDR cannot
>>>> be used for deleting IPv4 address but only for IPv6 addresses.
>>>>
>>>> Signed-off-by: Pali Rohár 
>>>> ---
>>>>  man7/netdevice.7 | 50 +---
>>>>  1 file changed, 43 insertions(+), 7 deletions(-)
>>>
>>> Hello! Is something else needed for this patch?
>>
>> Hello Pali,
>>
>> Sorry, I forgot to comment a few more formatting/wording issues: see
>> below.  Apart from that, I'd prefer Michael to review this one.
>>
>> Thanks,
>>
>> Alex
> 
> Hello Alex! I will try to explain configuring IPv4 and IPv6 addresses on
> network interfaces, so you probably could have better way how to improve
> description in "official" manpage. I'm not native English speaker, so I
> would follow any suggestions from you.
[...]

Hi Pali,

Thanks for explaining the process to me.
However, I don't feel that I understand it enough to help you co-writing
the text.  I lack much background to understand your explanation.  I'd
help you with the language happily, if it was only that :)

Maybe someone from netdev@ can help?  Or Michael?

Regards,

Alex


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


Re: [PATCH v3] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-19 Thread Alejandro Colomar (man-pages)
Hi Pali,

I was a patch for environ.7 while I found some pattern.
Please see below a minor fix.

Thanks,

Alex

On 1/16/21 11:36 PM, Pali Rohár wrote:
> 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.
> 
> Signed-off-by: Pali Rohár 
> ---
>  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

I found a few pages with the pattern [.BR X / Y],
but none like [.BR X " / " Y].

$ grep -rn '\.BR [a-zA-Z]* / [a-zA-Z]*' man?
man1/getent.1:365:.BR ahosts / getaddrinfo (3)
man2/sigaction.2:526:.BR SIGIO / SIGPOLL
man2/sigaction.2:638:.BR SIGIO / SIGPOLL
man2/sigaction.2:814:.BR SIGIO / SIGPOLL
man3/sysconf.3:181:.BR PAGESIZE / _SC_PAGESIZE .
man7/signal.7:539:.BR SIGINFO / SIGPWR
man7/pipe.7:114:.BR SIGPIPE / EPIPE
man7/environ.7:127:.BR EDITOR / VISUAL
$ grep -rn '\.BR [a-zA-Z]* " / " [a-zA-Z]*' man?
$

Please fix this for the next revision.
However, don't send a new one only for this.
I'd wait to see if someone reviews it or helps in any way ;)


>  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
> 


Re: [PATCH v2] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-10 Thread Alejandro Colomar (man-pages)
[ CC += netdev ]

On 1/10/21 5:38 PM, Pali Rohár wrote:
> On Saturday 02 January 2021 19:39:52 Pali Rohár wrote:
>> Also add description for struct in6_ifreq which is used for IPv6 addresses.
>>
>> SIOCSIFADDR and SIOCDIFADDR can be used to add or delete IPv6 address and
>> pppd is using these ioctls for a long time. Surprisingly SIOCDIFADDR cannot
>> be used for deleting IPv4 address but only for IPv6 addresses.
>>
>> Signed-off-by: Pali Rohár 
>> ---
>>  man7/netdevice.7 | 50 +---
>>  1 file changed, 43 insertions(+), 7 deletions(-)
> 
> Hello! Is something else needed for this patch?

Hello Pali,

Sorry, I forgot to comment a few more formatting/wording issues: see
below.  Apart from that, I'd prefer Michael to review this one.

Thanks,

Alex

> 
>> diff --git a/man7/netdevice.7 b/man7/netdevice.7
>> index 488e83d9a..12f94bfd7 100644
>> --- a/man7/netdevice.7
>> +++ b/man7/netdevice.7
>> @@ -55,9 +55,26 @@ struct ifreq {
>>  .EE
>>  .in
>>  .PP
>> +AF_INET6 is an exception.

[
.B AF_INET6
is an exception.
]

Sorry, this was my mistake on the previous review,
as I mixed expected output with actual code, and confused you.

>> +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
>> @@ -142,13 +159,32 @@ 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

[Get, set, or delete ...]

Note the extra comma (Oxford comma).

>> +.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

[addresses, and]

Rationale: clearly separate SIOCS* text from SIOCD* text.

>> +.B SIOCDIFADDR
>> +deletes only
>> +.B AF_INET6
>> +addresses.
>> +.B AF_INET
>> +address can be deleted by setting zero address via

Suggestion:

[
A
.B XXX
address ... by setting it to zero via
]

Although I don't know exactly how all this works,
so it's only a suggestion, but that needs some wording fix.

>> +.BR SIOCSIFADDR .
>>  .TP
>>  .BR SIOCGIFDSTADDR ", " SIOCSIFDSTADDR
>>  Get or set the destination address of a point-to-point device using
>> -- 
>> 2.20.1
>>


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


Re: arp(7) description of gc_stale_time

2021-04-14 Thread Alejandro Colomar (man-pages)

[CC += netdev]

On 4/12/21 12:13 AM, Adam Liddell wrote:

Hi,

Any opinion on this?

Adam

On Tue, 16 Feb 2021, at 17:00, Adam Liddell wrote:

Hi,

The arp(7) page's description of gc_stale_time doesn't quite describe
the behaviour correctly, at least as I understand it.

The current description suggests this is the time interval at which a
loop will look for stale entries. However, this field is the threshold
for marking an entry dead for removal, based on when it was last used
(see net/core/neighbour.c lines 935-942) and whether the table is over
gc_thresh1. How often this check is done appears to be determined by
base_reachable_time (/2) and the third option gc_interval is not
involved in this process as far as I can tell, despite its name.

Perhaps a draft alternate description could be something along the lines of:

Determines the threshold for removing a cache entry after it was last
used and when the cache is larger than gc_thresh1. Defaults to 60
seconds.



Hi Adam,

Thanks for the ping.  I don't know, sorry.
I added netdev@ so that maybe they can give an opinion.  In the 
man-pages, that text has been there since we use git, so I don't know 
who wrote it.


Thanks,

Alex


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


Re: netdevice.7 SIOCGIFFLAGS/SIOCSIFFLAGS

2021-04-14 Thread Alejandro Colomar (man-pages)

[CC += netdev]

Hi Erik,

On 4/14/21 8:52 PM, Erik Flodin wrote:

Hi,

On Fri, 19 Mar 2021 at 20:53, Alejandro Colomar (man-pages)
 wrote:

On 3/17/21 3:12 PM, Erik Flodin wrote:

The documentation for SIOCGIFFLAGS/SIOCSIFFLAGS in netdevice.7 lists
IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO, but those can't be set in
ifr_flags as it is only a short and the flags start at 1<<16.

See also 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=746e6ad23cd6fec2edce056e014a0eabeffa838c



I don't know what's the history of that.


Judging from commit message in the commit linked above it was added by
mistake. As noted the flags are accessible via netlink, just not via
SIOCGIFFLAGS.

// Erik



I should have CCd netdev@ before.  Thanks for the update.  Let's see if 
anyone there can comment.


Thanks,

Alex


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


Re: [PATCH v3] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-28 Thread Alejandro Colomar (man-pages)
Hi Pali,

On 1/16/21 11:36 PM, Pali Rohár wrote:
> 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.
> 
> Signed-off-by: Pali Rohár 

Patch applied!

Thanks,

Alex

> ---
>  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
> 

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


Re: [PATCH v3] netdevice.7: Update documentation for SIOCGIFADDR SIOCSIFADDR SIOCDIFADDR

2021-01-28 Thread Alejandro Colomar (man-pages)
Hi Pali,

On 1/27/21 8:29 PM, Pali Rohár wrote:
[...]
>>
>> Please fix this for the next revision.
>> However, don't send a new one only for this.
> 
> Ok!

I fixed that already.

> 
>> I'd wait to see if someone reviews it or helps in any way ;)
> 
> Seems that nobody came up with suggestions for improvements...

Thanks for the ping.

I applied v3 with some minor fixes.

Thanks,

Alex

> 
>>
>>>  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
>>>

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