[Swan-dev] what is nat_traversal_new_mapping(nfo_st, ...) looking for?

Andrew Cagney andrew.cagney at gmail.com
Thu Jul 4 15:47:04 UTC 2019


The code is roughly:

  for st in all states do:
    if ((IS_CHILD_SA(nfo_st) &&
        (st->st_serialno == nfo_st->st_clonedfrom ||
         st->st_clonedfrom == nfo_st->st_clonedfrom)) ||
        st->st_serialno == nfo_st->st_serialno) {
            do stuff
    }

if I transform the if() I get:

    if ((IS_CHILD_SA(nfo_st) && st->st_serialno == nfo_st->st_clonedfrom) ||
        (IS_CHILD_SA(nfo_st) && st->st_clonedfrom == nfo_st->st_clonedfrom) ||
        st->st_serialno == nfo_st->st_serialno)

which makes me suspect it is looking for:

- nfo_st's IKE SA
- nfo_st's siblings
- and of course nfo_st

or in other words it wants to 'do stuff' on ST's entire family?  I
guess that makes sense, just not very efficient.

Andrew


More information about the Swan-dev mailing list