]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/net/dst.h
net: Abstract default ADVMSS behind an accessor.
[mv-sheeva.git] / include / net / dst.h
index 755ac6c1aa037d969154be240ffd29bda4938862..03a1c3d52d808c06f9349405c30f85663bcaf313 100644 (file)
@@ -112,10 +112,22 @@ dst_metric_raw(const struct dst_entry *dst, const int metric)
 static inline u32
 dst_metric(const struct dst_entry *dst, const int metric)
 {
-       WARN_ON_ONCE(metric == RTAX_HOPLIMIT);
+       WARN_ON_ONCE(metric == RTAX_HOPLIMIT ||
+                    metric == RTAX_ADVMSS);
        return dst_metric_raw(dst, metric);
 }
 
+static inline u32
+dst_metric_advmss(const struct dst_entry *dst)
+{
+       u32 advmss = dst_metric_raw(dst, RTAX_ADVMSS);
+
+       if (!advmss)
+               advmss = dst->ops->default_advmss(dst);
+
+       return advmss;
+}
+
 static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
 {
        dst->_metrics[metric-1] = val;