projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovs-vlan-test: clearly indicate failure.
[openvswitch]
/
lib
/
packets.c
diff --git
a/lib/packets.c
b/lib/packets.c
index 29c4e7e4a9e3a9bd9820d69fb9afb84f5d6ee8bb..2dc82fe12e0d138cf821218fd7633cbfa24f58a4 100644
(file)
--- a/
lib/packets.c
+++ b/
lib/packets.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009
, 2010
Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-20,11
+20,16
@@
#include <stdlib.h>
#include "ofpbuf.h"
#include <stdlib.h>
#include "ofpbuf.h"
+/* Parses 's' as a 16-digit hexadecimal number representing a datapath ID. On
+ * success stores the dpid into '*dpidp' and returns true, on failure stores 0
+ * into '*dpidp' and returns false.
+ *
+ * Rejects an all-zeros dpid as invalid. */
bool
dpid_from_string(const char *s, uint64_t *dpidp)
{
bool
dpid_from_string(const char *s, uint64_t *dpidp)
{
- *dpidp = (strlen(s) == 1
2 && strspn(s, "0123456789abcdefABCDEF") == 12
- ? strtoll(s, NULL, 16)
+ *dpidp = (strlen(s) == 1
6 && strspn(s, "0123456789abcdefABCDEF") == 16
+ ? strto
u
ll(s, NULL, 16)
: 0);
return *dpidp != 0;
}
: 0);
return *dpidp != 0;
}