Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78804
b: refs/heads/master
c: 28d36e3
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jan 28, 2008
1 parent 128f7e0 commit 9b0c7a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39a6d06300128d32f361f4f790beba0ca83730eb
refs/heads/master: 28d36e3702fcbed73c38e877bcf2a8f8946b7f3d
22 changes: 12 additions & 10 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,18 +2284,16 @@ static void seq_indent(struct seq_file *seq, int n)
while (n-- > 0) seq_puts(seq, " ");
}

static inline const char *rtn_scope(enum rt_scope_t s)
static inline const char *rtn_scope(char *buf, size_t len, enum rt_scope_t s)
{
static char buf[32];

switch (s) {
case RT_SCOPE_UNIVERSE: return "universe";
case RT_SCOPE_SITE: return "site";
case RT_SCOPE_LINK: return "link";
case RT_SCOPE_HOST: return "host";
case RT_SCOPE_NOWHERE: return "nowhere";
default:
snprintf(buf, sizeof(buf), "scope=%d", s);
snprintf(buf, len, "scope=%d", s);
return buf;
}
}
Expand All @@ -2315,13 +2313,11 @@ static const char *rtn_type_names[__RTN_MAX] = {
[RTN_XRESOLVE] = "XRESOLVE",
};

static inline const char *rtn_type(unsigned t)
static inline const char *rtn_type(char *buf, size_t len, unsigned t)
{
static char buf[32];

if (t < __RTN_MAX && rtn_type_names[t])
return rtn_type_names[t];
snprintf(buf, sizeof(buf), "type %u", t);
snprintf(buf, len, "type %u", t);
return buf;
}

Expand Down Expand Up @@ -2359,13 +2355,19 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, " |-- %d.%d.%d.%d\n", NIPQUAD(val));
for (i = 32; i >= 0; i--) {
struct leaf_info *li = find_leaf_info(l, i);

if (li) {
struct fib_alias *fa;

list_for_each_entry_rcu(fa, &li->falh, fa_list) {
char buf1[32], buf2[32];

seq_indent(seq, iter->depth+1);
seq_printf(seq, " /%d %s %s", i,
rtn_scope(fa->fa_scope),
rtn_type(fa->fa_type));
rtn_scope(buf1, sizeof(buf1),
fa->fa_scope),
rtn_type(buf2, sizeof(buf2),
fa->fa_type));
if (fa->fa_tos)
seq_printf(seq, "tos =%d\n",
fa->fa_tos);
Expand Down

0 comments on commit 9b0c7a9

Please sign in to comment.