Re: Small ifconfig output tweak for inet6?
* Florian Obser flor...@openbsd.org [2015-03-26 18:36]: On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? Of course this breaks stuff :) uh, now that you mention it, I didn't chose a very obvious way to ask the question - of course the ifconfig output change breaks scripts parsing ifconfig output, the real question being: how common are scripts doing that? -- Henning Brauer, h...@bsws.de, henn...@openbsd.org BS Web Services GmbH, http://bsws.de, Full-Service ISP Secure Hosting, Mail and DNS. Virtual Dedicated Servers, Root to Fully Managed Henning Brauer Consulting, http://henningbrauer.com/
Re: Small ifconfig output tweak for inet6?
On 2015 Mar 27 (Fri) at 11:54:16 +0100 (+0100), Henning Brauer wrote: :* Florian Obser flor...@openbsd.org [2015-03-26 18:36]: : On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: : * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: : however I agree that if we do this for ipv6 we should do it for ipv4 as well : but then do we care about tons of stuff out there parsing ifconfig output? : that's the prime question. I would love to move to CIDR notation - are : we breaking people's scripts with that? The inet side has been the same : for, what, decades? : Of course this breaks stuff :) : :uh, now that you mention it, I didn't chose a very obvious way to ask :the question - of course the ifconfig output change breaks scripts :parsing ifconfig output, the real question being: how common are :scripts doing that? : I am happy to break scripts, when people aren't using CIDR ;) -- Due to lack of disk space, this fortune database has been discontinued.
Re: Small ifconfig output tweak for inet6?
On 2015/03/27 12:23, Peter Hessler wrote: On 2015 Mar 27 (Fri) at 11:54:16 +0100 (+0100), Henning Brauer wrote: :* Florian Obser flor...@openbsd.org [2015-03-26 18:36]: : On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: : * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: : however I agree that if we do this for ipv6 we should do it for ipv4 as well : but then do we care about tons of stuff out there parsing ifconfig output? : that's the prime question. I would love to move to CIDR notation - are : we breaking people's scripts with that? The inet side has been the same : for, what, decades? : Of course this breaks stuff :) : :uh, now that you mention it, I didn't chose a very obvious way to ask :the question - of course the ifconfig output change breaks scripts :parsing ifconfig output, the real question being: how common are :scripts doing that? : I am happy to break scripts, when people aren't using CIDR ;) It'll need an accompanying change to Ansible's fact gatherer. Facter seems ok with it though.
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) non-contiguous netmasks for IPv4 addresses configured on an interface? is that possible? what's the use case? perhaps you're confusing this with non-contiguous netmasks in the radix tree that are entered by the ipsec flows containing port numbers? I don't think we need to worry about non-contiguous netmasks here. however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? The v6_info() function in the installer would need a change, but that's an easy fix. -- -=[rpe]=-
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) non-contiguous netmasks for IPv4 addresses configured on an interface? is that possible? what's the use case? perhaps you're confusing this with non-contiguous netmasks in the radix tree that are entered by the ipsec flows containing port numbers? I don't think we need to worry about non-contiguous netmasks here. however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? The v6_info() function in the installer would need a change, but that's an easy fix. The way we have handled this in the past is: - all input paths must cope - before an output path is changed - to support cut paste - to support scripted changes Normally, we need a full release cycle, to make sure noone gets screwed... Maybe there is a fast path? But.. maybe not.
Re: Small ifconfig output tweak for inet6?
On 2015/03/26 13:48, Martin Pieuchot wrote: How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 While here can I convert autoconfprivacy to privacy or +privacy? Index: ifconfig.c === RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.296 diff -u -p -r1.296 ifconfig.c --- ifconfig.c5 Feb 2015 10:30:25 - 1.296 +++ ifconfig.c26 Mar 2015 12:15:10 - @@ -3192,7 +3192,7 @@ in6_alias(struct in6_ifreq *creq) warn(SIOCGIFNETMASK_IN6); } else { sin6 = (struct sockaddr_in6 *)ifr6.ifr_addr; - printf( prefixlen %d, prefix(sin6-sin6_addr, + printf(/%d, prefix(sin6-sin6_addr, sizeof(struct in6_addr))); } seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) @@ -3216,7 +3216,7 @@ in6_alias(struct in6_ifreq *creq) if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_AUTOCONF) printf( autoconf); if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_PRIVACY) - printf( autoconfprivacy); + printf( privacy); } if (scopeid) I do prefer privacy here, but generally the printed flags match the name used to configure them so this would be better if the cmds[] table and manual changed too. (But then we might want to keep backwards compat to reduce risk of people locking themselves out of remote machines if they have a flag in the wrong place on a hostname.if line)...
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: | How do people feel about printing the prefixlen in CIDR notation? I'm | annoyed about outputs not fitting in 80 chars when using autoconf magic: | | -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 | +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 Love this! And you can still copy/paste from 'inet6' upto '64' into an ifconfig line to get that address configured on an interface. | While here can I convert autoconfprivacy to privacy or +privacy? 'autoconfprivacy' seems too long to me too, yeah... Cheers, Paul 'WEiRD' de Weerd | Index: ifconfig.c | === | RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v | retrieving revision 1.296 | diff -u -p -r1.296 ifconfig.c | --- ifconfig.c5 Feb 2015 10:30:25 - 1.296 | +++ ifconfig.c26 Mar 2015 12:15:10 - | @@ -3192,7 +3192,7 @@ in6_alias(struct in6_ifreq *creq) | warn(SIOCGIFNETMASK_IN6); | } else { | sin6 = (struct sockaddr_in6 *)ifr6.ifr_addr; | - printf( prefixlen %d, prefix(sin6-sin6_addr, | + printf(/%d, prefix(sin6-sin6_addr, | sizeof(struct in6_addr))); | } | | @@ -3216,7 +3216,7 @@ in6_alias(struct in6_ifreq *creq) | if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_AUTOCONF) | printf( autoconf); | if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_PRIVACY) | - printf( autoconfprivacy); | + printf( privacy); | } | | if (scopeid) | -- [++-]+++.+++[---].+++[+ +++-].++[-]+.--.[-] http://www.weirdnet.nl/
Re: Small ifconfig output tweak for inet6?
On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) non-contiguous netmasks for IPv4 addresses configured on an interface? is that possible? what's the use case? perhaps you're confusing this with non-contiguous netmasks in the radix tree that are entered by the ipsec flows containing port numbers? however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output?
Small ifconfig output tweak for inet6?
How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 While here can I convert autoconfprivacy to privacy or +privacy? Index: ifconfig.c === RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.296 diff -u -p -r1.296 ifconfig.c --- ifconfig.c 5 Feb 2015 10:30:25 - 1.296 +++ ifconfig.c 26 Mar 2015 12:15:10 - @@ -3192,7 +3192,7 @@ in6_alias(struct in6_ifreq *creq) warn(SIOCGIFNETMASK_IN6); } else { sin6 = (struct sockaddr_in6 *)ifr6.ifr_addr; - printf( prefixlen %d, prefix(sin6-sin6_addr, + printf(/%d, prefix(sin6-sin6_addr, sizeof(struct in6_addr))); } @@ -3216,7 +3216,7 @@ in6_alias(struct in6_ifreq *creq) if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_AUTOCONF) printf( autoconf); if (ifr6.ifr_ifru.ifru_flags6 IN6_IFF_PRIVACY) - printf( autoconfprivacy); + printf( privacy); } if (scopeid)
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? Of course this breaks stuff :) Diff at the end (for those interested) shows in which way it breaks ansible - which I understand the cool kids use these days... Note to self: ansible should care about pltime... We could port libxo. /me runs away giggling like an idiot --- setup1.txt Thu Mar 26 18:21:12 2015 +++ setup2.txt Thu Mar 26 18:21:24 2015 @@ -4,22 +4,23 @@ 10.11.12.32 ], ansible_all_ipv6_addresses: [ -fe80::5054:ff:fedc:6fcd%vio0, -:::1:5054:ff:fedc:6fcd, -:::1:e02b:adec:a4ce:f04d +fe80::1%lo0/64, +fe80::5054:ff:fedc:6fcd%vio0/64, +:::1:5054:ff:fedc:6fcd/64, +:::1:e02b:adec:a4ce:f04d/64 ], ansible_architecture: amd64, @@ -49,7 +50,7 @@ type: unknown }, ansible_default_ipv6: { -address: fe80::5054:ff:fedc:6fcd%vio0, +address: fe80::5054:ff:fedc:6fcd%vio0/64, device: vio0, flags: [ UP, @@ -65,8 +66,6 @@ media: Ethernet, media_select: autoselect, mtu: 1500, -prefix: 64, -scope: 0x1, status: active, type: unknown }, @@ -119,13 +118,10 @@ ], ipv6: [ { -address: fe80::1%lo0, -prefix: 64, -scope: 0x3 +address: fe80::1%lo0/64 }, { -address: ::1, -prefix: 128 +address: ::1/128 } ], macaddress: unknown, @@ -176,17 +172,13 @@ ], ipv6: [ { -address: fe80::5054:ff:fedc:6fcd%vio0, -prefix: 64, -scope: 0x1 +address: fe80::5054:ff:fedc:6fcd%vio0/64 }, { -address: :::1:5054:ff:fedc:6fcd, -prefix: 64 +address: :::1:5054:ff:fedc:6fcd/64 }, { -address: :::1:e02b:adec:a4ce:f04d, -prefix: 64 +address: :::1:e02b:adec:a4ce:f04d/64 } ], macaddress: 52:54:00:dc:6f:cd, -- I'm not entirely sure you are real.
Re: Small ifconfig output tweak for inet6?
* Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) non-contiguous netmasks for IPv4 addresses configured on an interface? is that possible? what's the use case? perhaps you're confusing this with non-contiguous netmasks in the radix tree that are entered by the ipsec flows containing port numbers? I don't think we need to worry about non-contiguous netmasks here. however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? -- Henning Brauer, h...@bsws.de, henn...@openbsd.org BS Web Services GmbH, http://bsws.de, Full-Service ISP Secure Hosting, Mail and DNS. Virtual Dedicated Servers, Root to Fully Managed Henning Brauer Consulting, http://henningbrauer.com/
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 for real prefixes this still doesn't fit: inet6 :BBB::1:5054:ff:fedc:6fcd/64 autoconf pltime 604776 vltime 2591976 inet6 :BBB::1:e02b:adec:a4ce:f04d/64 autoconf privacy pltime 85586 vltime 604173 -- I'm not entirely sure you are real.
Re: Small ifconfig output tweak for inet6?
On 26/03/15(Thu) 17:46, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: On 26 March 2015 at 14:27, Stuart Henderson st...@openbsd.org wrote: seems reasonable. (I'd quite like that for v4 too, though it wouldn't cope with non-contiguous netmask ;) non-contiguous netmasks for IPv4 addresses configured on an interface? is that possible? what's the use case? perhaps you're confusing this with non-contiguous netmasks in the radix tree that are entered by the ipsec flows containing port numbers? I don't think we need to worry about non-contiguous netmasks here. My plan is to stop supporting them in the routing table first... Does that ring any bell? :o) So let's start simple, CIDR notation for IPv6, ok? Index: ifconfig.c === RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v retrieving revision 1.296 diff -u -p -r1.296 ifconfig.c --- ifconfig.c 5 Feb 2015 10:30:25 - 1.296 +++ ifconfig.c 26 Mar 2015 17:15:54 - @@ -3192,7 +3192,7 @@ in6_alias(struct in6_ifreq *creq) warn(SIOCGIFNETMASK_IN6); } else { sin6 = (struct sockaddr_in6 *)ifr6.ifr_addr; - printf( prefixlen %d, prefix(sin6-sin6_addr, + printf(/%d, prefix(sin6-sin6_addr, sizeof(struct in6_addr))); }
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 06:50:37PM +0100, Martin Pieuchot wrote: On 26/03/15(Thu) 17:39, Florian Obser wrote: On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 for real prefixes this still doesn't fit: inet6 :BBB::1:5054:ff:fedc:6fcd/64 autoconf pltime 604776 vltime 2591976 inet6 :BBB::1:e02b:adec:a4ce:f04d/64 autoconf privacy pltime 85586 vltime 604173 What are you suggesting? To not print 'autoconf'? Use less left margin? Move the 80char limit to 100? That the CIDR notation is not worth it? I'm not suggesting anything, I don't know how to solve this. I would love if it fits on 80 cols. I don't feel strongly either way, so I'll shut up. -- I'm not entirely sure you are real.
Re: Small ifconfig output tweak for inet6?
On 26/03/15(Thu) 17:39, Florian Obser wrote: On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: How do people feel about printing the prefixlen in CIDR notation? I'm annoyed about outputs not fitting in 80 chars when using autoconf magic: -inet6 fd00::f2de:f1ff:fe6a:15d1 prefixlen 64 autoconf pltime 3594 vltime 7194 +inet6 fd00::f2de:f1ff:fe6a:15d1/64 autoconf pltime 3594 vltime 7194 for real prefixes this still doesn't fit: inet6 :BBB::1:5054:ff:fedc:6fcd/64 autoconf pltime 604776 vltime 2591976 inet6 :BBB::1:e02b:adec:a4ce:f04d/64 autoconf privacy pltime 85586 vltime 604173 What are you suggesting? To not print 'autoconf'? Use less left margin? Move the 80char limit to 100? That the CIDR notation is not worth it?
Re: Small ifconfig output tweak for inet6?
On 26/03/15(Thu) 17:35, Florian Obser wrote: On Thu, Mar 26, 2015 at 05:46:12PM +0100, Henning Brauer wrote: * Mike Belopuhov m...@belopuhov.com [2015-03-26 14:36]: however I agree that if we do this for ipv6 we should do it for ipv4 as well but then do we care about tons of stuff out there parsing ifconfig output? that's the prime question. I would love to move to CIDR notation - are we breaking people's scripts with that? The inet side has been the same for, what, decades? Of course this breaks stuff :) Diff at the end (for those interested) shows in which way it breaks ansible - which I understand the cool kids use these days... Note to self: ansible should care about pltime... We could port libxo. /me runs away giggling like an idiot Well just use inet_net_pton(3) and call it a day. You see, I'm trying to help people writing parsers ;)
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: While here can I convert autoconfprivacy to privacy or +privacy? Please don't change this. The name of the option was chosen such that web searches come up with the proper RFC and related references.
Re: Small ifconfig output tweak for inet6?
On Thu, Mar 26, 2015 at 01:48:03PM +0100, Martin Pieuchot wrote: While here can I convert autoconfprivacy to privacy or +privacy? Please don't change this. The name of the option was chosen such that web searches come up with the proper RFC and related references. Yes, I agree. The inet6 semantic space is so messed up and complicated, so the term was chosen narrow and specific.