]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
filter: HWHDR: simplify flow-control
authorJeremy Sowden <jeremy@azazel.net>
Tue, 30 Nov 2021 10:55:31 +0000 (10:55 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Nov 2021 19:55:17 +0000 (20:55 +0100)
commitb612f69e558bb9dad8140c1d793955e1fb2d9332
treed13f7da59e833f822ead00546479cffde0f27f6c
parente9ae548078135f047b855177906040d86d75ee08
filter: HWHDR: simplify flow-control

The `interp_mac2str` function concludes with a `switch` followed by a
`return` statement.

The `switch` has one case falling through to a default:

  switch (expr) {
  case X:
    // ... X code ...
  default:
    // ... default code ...
  }

This is equivalent to the simpler and more readily comprehensible:

  if (expr == X) {
    // ... X code ...
  }
  // ... default code ...

Replace the former with the latter.

Doing so makes it obvious that the following `return` statement is never
reached.  Remove it.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
filter/ulogd_filter_HWHDR.c