Date: Sat, 4 Jan 2014 06:39:35 -0500 From: Jason Hellenthal <jhellenthal@dataix.net> To: Devin Teske <dteske@freebsd.org> Cc: "rc@freebsd.org" <rc@freebsd.org>, "net@freebsd.org" <net@freebsd.org> Subject: Re: network.subr _aliasN handling Message-ID: <447D4E19-A122-4361-974F-DBDE70DBF593@dataix.net> In-Reply-To: <AFFFCC9A-8C21-4C0B-A8D9-457E4C26DDA3@fisglobal.com> References: <20131228055324.GA72764@aim7400.DataIX.local> <A7699871-A170-4AD5-B740-ED8BE17C7107@fisglobal.com> <9498BE8E-8090-4E7A-8317-18D29B1DDC08@dataix.net> <7DBA7D58-E925-47BC-967C-F653348426A6@fisglobal.com> <A15FAFBD-4597-4D8D-A014-0D486573894C@dataix.net> <AFFFCC9A-8C21-4C0B-A8D9-457E4C26DDA3@fisglobal.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Alright that's what I thought was going on or at least seemed like it when I read the output of ifconfig but didn't delve to deep into it.
When I hear sort(1) particular circumstances come to mind from experience that hit me in the past so just for clarity wanted to see if I was on the same page with what you were thinking.
Thanks Devin much appreciated and sure it will be by the rest of the community as well.
--
Jason Hellenthal
Voice: 95.30.17.6/616
JJH48-ARIN
> On Jan 4, 2014, at 6:25, "Teske, Devin" <Devin.Teske@fisglobal.com> wrote:
>
>> On Jan 4, 2014, at 2:59 AM, Jason Hellenthal wrote:
>>
>> I believe I know what you mean by that but in a way scares me when you say sort as in mixing up the original order they appear in which I would find to be really unattractive to most.
>
> It's not as scary as it sounds.
>
> The issue is that the variables are sorted alphabetically, instead
> of numerically.
>
> Let's take four words: foo1, foo2, foo10, and foo20.
> If you sort them alphabetically, you get:
>
> foo1
> foo10
> foo2
> foo20
>
> You'll notice this when doing a directory listing, as that too is sorted
> alphabetically.
>
> This is why "alias14" is run before "alias8" and "alias9". Because they
> are processed in alphabetically sorted order. I didn't do anything to sort
> the values, they came pre-sorted in alphabetic order.
>
> If I simply throw in a "| sort -n", then it will change it to numerically sorted.
> As you might expect, numerically sorting the above list would result in:
>
> foo1
> foo2
> foo10
> foo20
>
> Trivial really. I'll throw a patch at you when I get some cycles (soon).
> --
> Devin
>
>
>>> On Jan 4, 2014, at 5:29, "Teske, Devin" <Devin.Teske@fisglobal.com> wrote:
>>>
>>>
>>>> On Jan 3, 2014, at 10:28 PM, Jason Hellenthal wrote:
>>>>
>>>> Alright something is a little off about this from a running standpoint it did what it is meant to do.
>>>>
>>>> Bug1: it seems to have looped back over itself reissuing two addresses from the top of the list.
>>>>
>>>> Test case:
>>>> I have aliases 0-14 used numbered as such.
>>>> Aliases 0-7 are ipv6
>>>> Aliases 8-14 are ipv4
>>>>
>>>> I commented out alias 2 and 6 to break up consecutive order.
>>>>
>>>> Alias 8 & 9 appeared to have been run after alias 14.
>>>>
>>>>
>>>> Something is awry but I can't quite pick out what it is yet.
>>>
>>> Sounds like I need to add some numerical sorting.
>>> --
>>> Devin
>>>
>>>
>>>
>>>>
>>>>> On Dec 28, 2013, at 23:24, "Teske, Devin" <Devin.Teske@fisglobal.com> wrote:
>>>>>
>>>>>
>>>>>> On Dec 27, 2013, at 9:53 PM, <jhellenthal@dataix.net> wrote:
>>>>>>
>>>>>> Curious what everyone's opinion would be on modifying the handling of _aliasN functions or providing a wrapper around it to handle non-sequential ordering.
>>>>>>
>>>>>> My goal on this is simple and based around groupings similiar to that of the way user id(1)'s in passwd and group are handled or denoted for use on modern systems.
>>>>>>
>>>>>> I.e.: I would like to achieve this...
>>>>>>
>>>>>> *_alias[1-99] = System type addresses "Importand addresses or internal"
>>>>>> *_alias[100-199] = Aliases for interface 1
>>>>>> *_alias[200-299] = Aliases for interface 2
>>>>>> etc...
>>>>>>
>>>>>> NOt looking to achieve some sort of prefered naming convention for the interface aliases, but loosen them so they may be defined by the user in whatever means neccesary to their benefit.
>>>>>>
>>>>>> In a scheme similiar to above I attempted to set an address on every other 4th alias leaving 3 space rule room for insertion of further addresses but was surprised when the processing of the aliases ceased at the first non-sequential space.
>>>>>>
>>>>>> So why not just grab every _aliasN no matter of what it is for the interface and shove them into an arrary to be processed by a "for" statement ? the order would still be kept without having to inspect every defintion of alias and incrementing prehistorically.
>>>>>>
>>>>>> As well this could provide early loading of the addresses into their respective arrays so they may be processed and provided to any other functions that may need to access them earlier on in script fallthrough.
>>>>>>
>>>>>> Looking at _alias'N' sequentialy feels like a neucense.
>>>>>
>>>>> You mean something like the attached?
>>>>> --
>>>>> Devin
>>>>>
>>>>> _____________
>>>>> The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
>>>>> <patch.txt>
>>>
>>> _____________
>>> The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
>
> _____________
> The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
[-- Attachment #2 --]
0 *H
010 + 0 *H
90000
*H
010 UIL10U
StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0
130518085048Z
140519220947Z0H10Ujhellenthal@dataix.net1%0# *H
jhellenthal@dataix.net0"0
*H
0
'`TmfkܨJ5u+c'Upb`zv)&ȸXZ*VN6JvLoVoh}g
pQDŽKf/tZA˳("4Ԅ˻'d2h|IBl'^v^;'e8S99ۿVm|k8_UQtC"5l!kjZ]އQGn\Bh!FTsD%pV^Eӑd¨x"9
г"f 00 U0 0U0U%0++0UڔfmVʢ$䟓0U#0Sr풜\|~5NԸQ0!U0jhellenthal@dataix.net0LU C0?0;+70*0.+"http://www.startssl.com/policy.pdf0+00' StartCom Certification Authority0This certificate was issued according to the Class 1 Validation requirements of the StartCom CA policy, reliance only for the intended purpose in compliance of the relying party obligations.06U/0-0+)'%http://crl.startssl.com/crtu1-crl.crl0+009+0-http://ocsp.startssl.com/sub/class1/client/ca0B+06http://aia.startssl.com/certs/sub.class1.client.ca.crt0#U0http://www.startssl.com/0
*H
{0Ӹ,52W{Ey8b[{7 _+P"n["-,@ŽpJ-W$ݍjWA-6z( RdIZ.KzXє[K6}{s+v.Qh0PͅKhTw 0I73lz*Kv4Kkگ63;p1:ױ@)]ok>:W%XwC1þL/o8~#oP0400
*H
0}10 UIL10U
StartCom Ltd.1+0)U"Secure Digital Certificate Signing1)0'U StartCom Certification Authority0
071024210155Z
171024210155Z010 UIL10U
StartCom Ltd.1+0)U"Secure Digital Certificate Signing1806U/StartCom Class 1 Primary Intermediate Client CA0"0
*H
0
-).2AUGo#G
B|NDRpM-B=o-we5JQpa>O.#._<V
[~**pz~3WG .ᘟMlr[<Ce6fqO"uxfWN#uicgkv$Lb%y`_{`xK'GN 00U00U0USr풜\|~5NԸQ0U#0N@[i04hCA0f+Z0X0'+0http://ocsp.startssl.com/ca0-+0!http://www.startssl.com/sfsca.crt0[UT0R0'%#!http://www.startssl.com/sfsca.crl0'%#!http://crl.startssl.com/sfsca.crl0U y0w0u+70f0.+"http://www.startssl.com/policy.pdf04+(http://www.startssl.com/intermediate.pdf0
*H
}x,\c^#wMq}>UK/^yX֏y frMIŲB61ymQҨݬZ0&